Hi All,
We do have JSON data in the form
{
"data": [
{
"appName": "DemoApp",
"appVersion": "1.1",
"deviceId": "1234567",
"deviceName": "moto e",
"deviceOSVersion": "5.1",
"packageName": "com.abc.DemoApp",
"message": "testing null pointer exception",
"errorLog": "null pointer exception"
},
{
"appName": "DemoApp",
"appVersion": "1.1",
"deviceId": "1234567",
"deviceName": "moto e",
"deviceOSVersion": "5.1",
"packageName": "com.abc.DemoApp",
"message": "testing illegal state exception",
"errorLog": "illegal state exception"
}
]
}
We want to split data into separate messages and different fields like appName, appVersion etc.
My queries:
i) We use Split filter to split it into different fields and we are getting "data_appName" as field name instead of "appName"! how to change this field to "appName" etc without data_ prefix
ii) Message field contains both data not single data. how to split message field?
iii) We are getting %host in source field. I have tried to rename this using mutate plugin but it doesnt work. How can i rename field value in this??
filter in config file:
filter{
json {
source => "message"
}
mutate { gsub => [ "message", "},", "shr" ] }
split {
terminator => "shr"
field => "data"
}
Please guide for both queries.
Regards,
Shrawan