# Logstash Multiline json format - Nagios XI Api

**URL:** <https://discuss.elastic.co/t/logstash-multiline-json-format-nagios-xi-api/139729>\
**Category:** Logstash\
**Created:** [July 12, 2018, 10:28am UTC](https://discuss.elastic.co/t/logstash-multiline-json-format-nagios-xi-api/139729 "2018-07-12T10:28:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Kefallonitis](https://avatars.discourse-cdn.com/v4/letter/a/f9ae1b/32.png) [@Alex\_Kefallonitis](https://discuss.elastic.co/u/Alex_Kefallonitis)\
**Post date:** [July 12, 2018, 10:28am UTC](https://discuss.elastic.co/t/logstash-multiline-json-format-nagios-xi-api/139729/1 "2018-07-12T10:28:47Z")

</div>

Hi all,

I have a problem parsing the below json format. Its Nagios XI api response .

{  
"recordcount": "xxx",  
"logentry": [  
{  
"instance\_id": "1",  
"entry\_time": "YYYY-MM-DD HH:MM:SS",  
"logentry\_type": "8192",  
"logentry\_data": "SERVICE ALERT: XXXX;OK;SOFT;1;OK - XXXX hit ratio 100.00%"  
},  
{  
"instance\_id": "1",  
"entry\_time": "YYYY-MM-DD HH:MM:SS",  
"logentry\_type": "8192",  
"logentry\_data": "SERVICE ALERT: XXXX;OK;SOFT;1;OK - XXXXX hit ratio 98.65%"  
},  
{  
"instance\_id": "1",  
"entry\_time": "YYYY-MM-DD HH:MM:SS",  
"logentry\_type": "2048",  
"logentry\_data": "HOST ALERT: XXXXX;SOFT;1;CRITICAL - XX.XX.XX.XX: rta nan, lost 100%"  
}  
]  
}

I have tried different codecs (json, json\_lines)

Multiline codec with different patterns .

Gsub to overwrite message.

But nothing seems to work. The message breaks in different parts and not recognized as json format. Any ideas ?

Any hints whould be greatly appreciated. Thanks in advanced

PS Sample config:

[https://pastebin.com/kWxFQLTd](https://pastebin.com/kWxFQLTd)

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 20, 2018, 5:47pm UTC](https://discuss.elastic.co/t/logstash-multiline-json-format-nagios-xi-api/139729/2 "2018-07-20T17:47:32Z")

</div>

Is this the only blob of data in the input file or can the files contain multiple JSON objects? If yes, what are they separated by?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 17, 2018, 5:47pm UTC](https://discuss.elastic.co/t/logstash-multiline-json-format-nagios-xi-api/139729/3 "2018-08-17T17:47:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
