# Logstash-filter-for multiple log formats

**URL:** <https://discuss.elastic.co/t/logstash-filter-for-multiple-log-formats/143145>\
**Category:** Logstash\
**Created:** [August 6, 2018, 10:53am UTC](https://discuss.elastic.co/t/logstash-filter-for-multiple-log-formats/143145 "2018-08-06T10:53:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dinesh1](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@dinesh1](https://discuss.elastic.co/u/dinesh1)\
**Post date:** [August 6, 2018, 10:53am UTC](https://discuss.elastic.co/t/logstash-filter-for-multiple-log-formats/143145/1 "2018-08-06T10:53:59Z")

</div>

Hi,

How to parse logs using filters in logstash, so that i will get fields in kibana

Examples of my logs shown below

2018-08-06 00:00:03,828 [Logging.java:http-nio-9093-exec-141:50] - Request "{"request":{"device\_info":{"device\_os\_version":"51.4","app\_version":"5.4","model\_name":"Plus","device\_id":"0F2A0199A4B7","uuid":"02A-F3-8199A4B7","time\_stamp":"2018-08-06T00:00:02","carrier":"data","device\_os":"ios","connection\_type":"cellular"},"token":{"username":"2121214072","type":"","visit\_type":""}}}"

2018-08-06 00:00:03,829 [Logging.java:http-nio-9093-exec-141:51] - Response {"status":"SUCCESS","response\_code":0,"response\_description":"Token Validated Successfully."}

---

<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:** [August 6, 2018, 11:02am UTC](https://discuss.elastic.co/t/logstash-filter-for-multiple-log-formats/143145/2 "2018-08-06T11:02:02Z")

</div>

Use a grok or dissect filter to extract the timestamp, logger name, and JSON string into separate fields, then use a json filter to parse the field with the JSON string.

---

<div class="post-metadata">

**Author:** ![dinesh1](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@dinesh1](https://discuss.elastic.co/u/dinesh1)\
**Post date:** [August 6, 2018, 11:05am UTC](https://discuss.elastic.co/t/logstash-filter-for-multiple-log-formats/143145/3 "2018-08-06T11:05:39Z")

</div>

thanks for your reply,

As Iam new to elk, i don't know about filters, please help me with an example

---

<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:** [August 6, 2018, 11:26am UTC](https://discuss.elastic.co/t/logstash-filter-for-multiple-log-formats/143145/4 "2018-08-06T11:26:31Z")

</div>

See [https://www.elastic.co/guide/en/logstash/current/config-examples.html](https://www.elastic.co/guide/en/logstash/current/config-examples.html) for a few example of filters.

---

<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:** [September 3, 2018, 11:26am UTC](https://discuss.elastic.co/t/logstash-filter-for-multiple-log-formats/143145/5 "2018-09-03T11:26:40Z")

</div>

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