Hello, I'm new to Logstash and was wondering if someone could help with my filter and how can I parse the rest of my json fields the intent is to bring out the other fields in "message" such that I can map them to ECS:
here is what I have for my filter:
filter {
if "redacted_platform" in [ls-source] {
json {
source => "message"
}
json {
source => "message"
}
}
}
here is what the result is coming out as the result:
"message" => "<165>Feb 15 00:0000 redacted_platform.net.Example.com redacted_platform {\"model\":{\"description\":\"Test model used for testing alerting configuration.\",\"created\":{\"by\":\"System\"},\"edited\":{\"by\":\"Nobody\"},\"name\":\"Unrestricted Test Model\",\"priority\":5},\"device\":{\"ip\":\"0.1.2.3\",\"hostname\":\"test-device.example.com\",\"macaddress\":\"00:11:22:33:44:55\",\"vendor\":\"Test Vendor\",\"label\":\"Test Device\"},\"triggeredComponents\":[{\"metric\":{\"label\":\"Test Metric\"},\"triggeredFilters\":[{\"comparatorType\":\"display\",\"filterType\":\"Test Metric Filter\",\"trigger\":{\"value\":\"Test filter value\"}}]}],\"breachUrl\":\"\",\"pbid\":123,\"score\":1,\"creationTime\":123456,\"time\":123456}",
"host" => "hostname.example.com",
"log_type" => "redacted_platform",
"@timestamp" => 2022-02-15 blah blah blah,
"type" => "redacted_platform",
"fields" => {
"event_type" => "redacted_platform"
},
"ls-source" => "redacted_platform",
"tags" => [
[0] "_jsonparsefailure"
],
"port" => 12345,
"@version" => "1",
"ecs" => {
"version" => "1.2.3"
},
"origin" => "redacted_platform",
"input" => {
"type" => "log"
},
"agent" => {
"name" => "123b456c",
"id" => "123b456c",
"version" => "1.2.3",
"hostname" => "123b456c",
"type" => "filebeat",
"ephemeral_id" => "123b456c"
},
"log" => {
"offset" => 0,
"file" => {
"path" => "/var/log/logstash/redacted_platform/test.json"
}
}
}