Closed iShark5060 closed 4 months ago
okay, I've added some Logging into the sourcecode and tracked around a bit. Seems like it doesn't find the fields (yes I know ... kinda crude):
Log output:
Feb 26 01:43:43 monitoring telegraf[9652]: 2024-02-26T00:43:43Z E! [processors.execd::SourceIP] stderr: "2024/02/26 01:43:43 E! Found nothing apparently: src_ip"
Feb 26 01:43:43 monitoring telegraf[9652]: 2024-02-26T00:43:43Z E! [processors.execd::SourceIP] stderr: "2024/02/26 01:43:43 E! This was empty somhow: src_ip"
Feb 26 01:43:43 monitoring telegraf[9652]: 2024-02-26T00:43:43Z E! [processors.execd::SourceIP] stderr: "2024/02/26 01:43:43 E! were done now. Data: [suricata map[dest_ip:10.50.60.1 dest_port:53 event_type:alert host:ChaosRouter path:/var/log/suricata/eve.json src_ip:10.50.60.100 src_port:65190] map[alert_action:allowed alert_category:Misc activity alert_gid:1 alert_metadata_created_at_0:2022_03_15 alert_metadata_former_category_0:INFO alert_metadata_signature_severity_0:Informational alert_metadata_updated_at_0:2022_11_30 alert_rev:4 alert_severity:3 alert_signature:ET INFO Observed Discord Domain in DNS Lookup (discord .com) alert_signature_id:2.035465e+06 app_proto:dns direction:to_server dns_query_0_id:44897 dns_query_0_opcode:0 dns_query_0_rrname:discord.com dns_query_0_rrtype:A dns_query_0_tx_id:8 dns_query_0_type:query flow_bytes_toclient:466 flow_bytes_toserver:395 flow_dest_ip:10.50.60.1 flow_dest_port:53 flow_id:3.99194650574119e+14 flow_pkts_toclient:4 flow_pkts_toserver:5 flow_src_ip:10.50.60.100 flow_src_port:65190 flow_start:2024-02-26T01:43:05.682768+0100 in_iface:bce1 pkt_src:wire/pcap proto:UDP timestamp:2024-02-26T01:43:33.514491+0100 tx_id:8] 1708908213514904703]"
meaning the plugin doesn't find the field "src_ip" for some reason.
ok, I was finally able to figure it out. Apparently the "src_ip" in my metrics are not fields, but tags. Had to convert them before passing them to the plugin. Works now.
[[processors.converter]]
[processors.converter.tags]
namepass = ["*suricata*"]
order = 1
string = ["src_ip"]
[[processors.converter]]
[processors.converter.tags]
namepass = ["*suricata*"]
order = 2
string = ["dest_ip"]
Hi, I am using your plugin to add GeoIP data to my OPNsense telegraf outputs. My setup is as follows:
OPNsense telegraf plugin [influxDB2 output] -> telegraf (input.influxDB_v2_listener) -> processors.execd -> output.influxdb2_v2
Telegraf config:
/etc/telegraf/geoip/GeoIP.conf:
journalctl -u telegraf:
(this had been running since around 2 hours - no errors)
I can also see that the plugin is called kinda constantly...![image](https://github.com/a-bali/telegraf-geoip/assets/15010489/56674e9f-cfea-4e86-9ddf-c2665c61c4a0)
Am I doing something terribly wrong? Thank you.