[[inputs.tail]] data_format = "json" files = ["/var/log/suricata/eve.json"] name_override = "suricata" tag_keys = ["event_type","src_ip","src_port","dest_ip","dest_port"] json_string_fields = ["*"]
[[inputs.tail]] data_format = "json" files = ["/var/log/suricata/eve.json"] name_override = "suricata" tag_keys = ["event_type","src_ip","src_port","dest_ip","dest_port"]# json_string_fields = ["*"] json_time_key = "timestamp" json_time_format = "2006-01-02T15:04:05-0700"
pw group mod wheel -m telegrafpw groupshow wheelwheel:*:0:root,telegraf
chmod 750 /var/log/suricatachmod 750 /var/log/suricata/eve.json
from(bucket: "opnsense") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r["_measurement"] == "suricata") |> group(columns: ["_time"]) |> last() |> group() |> keep(columns: ["_time", "src_ip", "src_port","event_type","dest_ip", "dest_port"])
[[inputs.suricata]] ## Data sink for Suricata stats log. # This is expected to be a filename of a # unix socket to be created for listening. source = "/tmp/suricata-stats.sock" # Delimiter for flattening field keys, e.g. subitem "alert" of "detect" # becomes "detect_alert" when delimiter is "_". delimiter = "_" # Detect alert logs --> this does not work with this version of Telegraf installer on OPNsense # alerts = false
file /tmp/suricata-stats.sock/tmp/suricata-stats.sock: socket
suricata doesn’t create the unix socket, but instead if connects to an existing one.
outputs: - eve-log: enabled: yes filetype: unix_stream filename: /tmp/suricata-stats.sock types: - stats: threads: yes - alert: # packet: yes # enable dumping of packet (without stream segments) # metadata: no # enable inclusion of app layer metadata with alert. Default yes # http-body: yes # Requires metadata; enable dumping of http body in Base64 # http-body-printable: yes # Requires metadata; enable dumping of http body in printable format # Enable the logging of tagged packets for rules using the # "tag" keyword. tagged-packets: yes http: yes tls: yes
{"timestamp":"2021-07-29T16:26:14.841116+0200","event_type":"stat (…)