Hello would appreciate help with logstash parsing data into elastisearch. Please check my log output. Using opnsense syslog to logstash's pfelk addon and can not figure out whe right mutate filter to get this done. Thanks in advance!
[2023-09-18T19:00:11,393][WARN ][logstash.outputs.elasticsearch][pfelk][9a2fc31c5c61406e9cc6f8d6347eb69f1288022841ff17a7d978e31bc0fa30d3] Could not index event to Elasticsearch. {:status=>400, :action=>["create", {:_id=>nil, :_index=>"logs-pfelk-firewall", :routing=>nil}, {"data_stream"=>{"namespace"=>"firewall", "type"=>"logs", "dataset"=>"pfelk"}, "log"=>{"syslog"=>{"hostname"=>"xxx.dedyn.io", "appname"=>"firewall", "priority"=>134, "severity"=>{"code"=>6, "name"=>"Informational"}, "facility"=>{"code"=>16, "name"=>"local0"}, "procid"=>"56356", "version"=>"1"}}, "type"=>"firewall", "event"=>{"reason"=>"match", "created"=>2023-09-18T17:00:11.000Z, "original"=>"<134>1 2023-09-18T19:00:11+02:00 fw.slote-g.dedyn.io filterlog 56356 - [meta sequenceId=\"1985\"] 77,,,02f4bab031b57d1e30553ce08e0ec131,vtnet0,match,block,in,4,0x0,,1,23097,0,none,17,udp,204,10.10.10.110,239.255.255.250,57488,1900,184\n", "dataset"=>"pfelk.firewall", "action"=>"block", "sequence"=>"1985"}, "network"=>{"direction"=>"ingress", "iana_number"=>"17", "protocol"=>"udp", "type"=>"ipv4"}, "pf"=>{"ttl"=>"1", "rule"=>{"subid"=>""}, "tos"=>"0x0", "id"=>"23097", "flags"=>"none", "packet"=>{}, "ecn"=>"", "anchor"=>"", "offset"=>"0"}, "destination"=>{"ip"=>"239.255.255.250", "service"=>"ssdp", "port"=>"1900"}, "@version"=>"1", "rule"=>{"id"=>"77", "uuid"=>"02f4bab031b57d1e30553ce08e0ec131"}, "tags"=>["pfelk", "firewall", "IP_Private_Source", "IP_Private_Destination"], "service"=>{"type"=>"system"}, "host"=>{"ip"=>"10.10.0.253"}, "pf_csv"=>["77", "", "", "02f4bab031b57d1e30553ce08e0ec131", "vtnet0", "match", "block", "in", "4", "0x0", "", "1", "23097", "0", "none", "17", "udp", "204", "10.10.10.110", "239.255.255.250", "57488", "1900", "184\n"], "interface"=>{"name"=>"vtnet0"}, "@timestamp"=>2023-09-18T17:00:11.151607752Z, "source"=>{"ip"=>"10.10.10.110", "packets"=>"204", "bytes"=>"184\n", "port"=>"57488"}}], :response=>{"create"=>{"_index"=>".ds-logs-pfelk-firewall-2023.09.10-000001", "_id"=>"Mzk8qYoBZN3EEBNfOlt8", "status"=>400, "error"=>{"type"=>"document_parsing_exception", "reason"=>"[1:1478] failed to parse field [source.bytes] of type [long] in document with id 'Mzk8qYoBZN3EEBNfOlt8'. Preview of field's value: '184\n'", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"For input string: \"184\n\""}}}}}
As you can see most of the logs are parsed successfully, but not all and I'm stuck for weeks now.