Hi,
I have a custom log generated by shell script as shown below:
06:48:18 PM CPU %user %nice %system %iowait %steal %idle
06:48:19 PM all 3.05 0.00 0.54 0.46 0.00 95.95
06:48:20 PM all 3.19 0.00 0.50 0.21 0.00 96.10
06:48:21 PM all 3.67 0.00 0.56 0.46 0.00 95.31
06:48:22 PM all 2.92 0.00 0.52 0.92 0.00 95.64
06:48:23 PM all 2.97 0.00 0.44 0.38 0.00 96.22
I used filebeat to transfer this log contents to Logstash. Log stash displays the below json file:
{
"_index": "logstash-2017.01.21",
"_type": "my_log",
"_id": "AVnBHC-fDiezc7ujylT8",
"_score": null,
"_source": {
"@timestamp": "2017-01-21T12:59:27.397Z",
"offset": 213953,
"@version": "1",
"beat": {
"hostname": "hypervisor.airframe.cbis.eirmnp.nsn-rdnet.net",
"name": "hypervisor.airframe.cbis.eirmnp.nsn-rdnet.net",
"version": "5.1.2"
},
"input_type": "log",
"host": "hypervisor.airframe.cbis.eirmnp.nsn-rdnet.net",
"source": "/root/sar_logs",
"message": "06:29:26 PM all 3.02 0.00 0.46 0.77 0.00 95.74",
"type": "my_log",
"tags": [
"beats_input_codec_plain_applied"
]
},
"fields": {
"@timestamp": [
1485003567397
]
},
"sort": [
1485003567397
]
}
The message filed in json is showing a string value. How can I convert or parse this message field into json?
is there any template available?
Regards,
Ramakrishna