Hi,
I want to split my json array into multiple events in logstash. I tried using split field but it doesn't seem to work that way for objects in array. So any reference which plugin should I use in logstash to process data. Data format is given below:
{ "problems": [{
"Diabetes": [{
"medications": [{
"medicationsClasses": [{
"className": [{
"associatedDrug": [{
"name": "asprin",
"dose": "",
"strength": "500 mg"
}],
"associatedDrug#2": [{
"name": "somethingElse",
"dose": "",
"strength": "500 mg"
}]
}],
"className2": [{
"associatedDrug": [{
"name": "asprin",
"dose": "",
"strength": "500 mg"
}],
"associatedDrug#2": [{
"name": "somethingElse",
"dose": "",
"strength": "500 mg"
}]
}]
}]
}]
}]
}]
}
Expected result : 4 different document containing
{ "problems": [{
"Diabetes": [{
"medications": [{
"medicationsClasses": [{
"className": [{
"associatedDrug": [{
"name": "asprin",
"dose": "",
"strength": "500 mg"
}]
}]
}]
}]
}]
}]
}
{ "problems": [{
"Diabetes": [{
"medications": [{
"medicationsClasses": [{
"className": [{
"associatedDrug#2": [{
"name": "somethingElse",
"dose": "",
"strength": "500 mg"
}]
}]
}]
}]
}]
}]
}
{ "problems": [{
"Diabetes": [{
"medications": [{
"medicationsClasses": [{
"className2": [{
"associatedDrug": [{
"name": "asprin",
"dose": "",
"strength": "500 mg"
}]
}]
}]
}]
}]
}]
}
{ "problems": [{
"Diabetes": [{
"medications": [{
"medicationsClasses": [{
"className2": [{
"associatedDrug#2": [{
"name": "somethingElse",
"dose": "",
"strength": "500 mg"
}]
}]
}]
}]
}]
}]
}
Expected Document is each associatedDrug in separate doc
Thanks!