Hi All,
I'm trying to parse json file but I'm getting error and incorrect result
the log file look like this:
{
"Records": [{
"EventVersion": "1.0",
"EventSubscriptionArn": "XXX",
"EventSource": "XXX",
"Sns": {
"SignatureVersion": "1",
"Timestamp": "2019-02-11T11:24:00.000",
"Signature": "XXX",
"SigningCertUrl": "XXX",
"MessageId": "XXX",
"Message": "{"notificationType":"Delivery","mail":{"timestamp":"2019-02-10T11:24:52.986Z","source":"XXX.com","sourceArn":"XXX.com","sourceIp":"212.00.00.100","sendingAccountId":"081469076013","messageId":"4654654-000000","destination":["XXX.com"]},"delivery":{"timestamp":"2019-02-11T11:24:54.199Z","processingTimeMillis":1213,"recipients":["XXX.com"],"smtpResponse":"100 2.6.0 01000168dc4d7f7a-3ae05619-0b9e-4deb-82d2-5555018-000000@email.amazonses.com [InternalId=001, Hostname=Aoutlook.com] 10536 bytes in 0.187, 54.735 KB/sec Queued mail for delivery","remoteMtaIp":"100.00.0.55","reporti":"amazonses.com"}}",
"MessageAttributes": {},
"Type": "Notification",
"UnsubscribeUrl": "XXX",
"TopicArn": "XXX",
"Subject": null
}
}]
}
the conf file look like this:
filter {
if "emails_logs" in [tags] {
json {
source => "message"
target => "message"
}
json {
source => "[message][Records]"
target => "[message][Records]"
}
split { field => "[message][Records][Sns]" }
split { field => "[message][Records][Sns][Message]" }
}
}
Can you help me to parse it?