Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
OS - 2.3.0
Describe the issue:
Hi, we have been migrating millions of logs from Data Dog to Opensearch and one of the service logs ( the message pasted below ) contains two @timestamps in original message, due to which its arising a conflict and throws a date parse time failure.
Original Log message :
message :{"**@timestamp**":"2023-07-12T10:12:46.842913+02:00","@version":"1","message":"{\"**@timestamp**\": \"2023-07-12 10:12:46\", \"event_user\": \"admin\", \"event\":\"finish\",\"state\": \"succeeded\", \"object\": \"prodovh_Environment\", \"user\": \"admin\", \"aborted_by\": \"-\",}","host":"test-prodovh.rod","severity":"info","selinux_enforced":"true","env":"prodovh","appenv":"common-prodovh","servertype":"mgmt"}
in logstash.conf
first I’m parsing the message with json module, this will split all the outer json fileds and value and results as below
“@timestamp”:“2023-07-12T10:12:46.842913+02:00”
“@version”:“1”
“message”:“{"@timestamp": "2023-07-12 10:12:46", "event_user": "admin", "event":"finish","state": "succeeded", "object": "prodovh_Environment", "user": "admin", "aborted_by": "-",}”
“host”:“test-prodvh.rod”
“severity”:“info”
“selinux_enforced”:“true”
“env”:“prodovh”
“appenv”:“prodvh”
“servertype”:“mgmt”
This will sync up correct timezone and seconds with opensearch
Further I am trying to parse the nested json “message” field it throws an date time parse failure because its trying to override the @timestamp field again.
I have tried renaming the @timestamp field using mutate filter and it doesn’t work and tried removing the field but It **omits the entire log message itself **
Can anyone give some ideas on how to deal with it please.
Configuration:
Relevant Logs or Screenshots: