Hi Magnus,
logstash turns each line into a json object and puts all of those objects in the file it creates in s3. hwoever, these objects are not embedded in a json array. they are simle added one after the otehr to the file.
instead of that output in the s3 file (what is simply some list of json objects)
{
"date": "2018-04-18T09:26:35.0039150-05:00",
"server": "abcd",
"offset": 74,
"level": "error",
"prospector": {
"type": "log"
},
"source": "/var/log/x_debug/x_debugyy.log",
"message": "2018-04-18T09:26:35.0039150-05:00|error|yyy|Checking Product..",
"logstash_input": "beats",
"tags": ["beats_input_codec_plain_applied"],
"@timestamp": "2018-05-07T12:52:15.481Z",
"@version": "1",
"beat": {
"name": "ip-xxxx",
"hostname": "ip-xxxx",
"version": "6.1.2"
},
"host": "ip-xxxx",
"log_message": "Checking Product..",
"fields": {
"source_system_id": "x_debug"
}
} {
"date": "2018-04-18T09:42:48.0478973-05:00",
"server": "yyy",
"offset": 154,
"level": "Information",
"prospector": {
"type": "log"
},
"source": "/var/log/x_debug/x_debugyy.log",
"message": "2018-04-18T09:42:48.0478973-05:00|Information|yyy|Checking Product..",
"logstash_input": "beats",
"tags": ["beats_input_codec_plain_applied"],
"@timestamp": "2018-05-07T12:52:15.481Z",
"@version": "1",
"beat": {
"name": "ip-xxx",
"hostname": "ip-xxx",
"version": "6.1.2"
},
"host": "ip-xxx",
"log_message": "Checking Product..",
"fields": {
"source_system_id": "x_debug"
}
}
I want below structure to be the output of the file generated by logstash in s3
[{
"date": "2018-04-18T09:26:35.0039150-05:00",
"server": "abcd",
"offset": 74,
"level": "error",
"prospector": {
"type": "log"
},
"source": "/var/log/x_debug/x_debugyy.log",
"message": "2018-04-18T09:26:35.0039150-05:00|error|yyy|Checking Product..",
"logstash_input": "beats",
"tags": ["beats_input_codec_plain_applied"],
"@timestamp": "2018-05-07T12:52:15.481Z",
"@version": "1",
"beat": {
"name": "ip-xxxx",
"hostname": "ip-xxxx",
"version": "6.1.2"
},
"host": "ip-xxxx",
"log_message": "Checking Product..",
"fields": {
"source_system_id": "x_debug"
}
} , {
"date": "2018-04-18T09:42:48.0478973-05:00",
"server": "yyy",
"offset": 154,
"level": "Information",
"prospector": {
"type": "log"
},
"source": "/var/log/x_debug/x_debugyy.log",
"message": "2018-04-18T09:42:48.0478973-05:00|Information|yyy|Checking Product..",
"logstash_input": "beats",
"tags": ["beats_input_codec_plain_applied"],
"@timestamp": "2018-05-07T12:52:15.481Z",
"@version": "1",
"beat": {
"name": "ip-xxx",
"hostname": "ip-xxx",
"version": "6.1.2"
},
"host": "ip-xxx",
"log_message": "Checking Product..",
"fields": {
"source_system_id": "x_debug"
}
}]