I am trying to add json data to my elasticsearch with arrays in its field. My setup works, but I want the arrays to become separate fields. Is this possible in logstash or should i create a json parser to fix my problem?
{
"name": "peter",
"occupation": "salesman",
"score": [{
"result": true,
"name": "reported"
},
{
"result": false,
"name": "processed"
}
],
"level": 38,
"categories": [{
"category": "owner",
"passed": false
},
{
"category": "worker",
"passed": true
}
]
}
My config file:
input { stdin {}
}
filter {
json {
source => "message"
target => "message"
}
}
output {
elasticsearch {
hosts => ["IP:9200"]
index => "worker"
document_id => "%{message}"
doc_as_upsert => true
action => "update"
retry_on_conflict => 10
}
}