# Pattern logstash to get multi information in log but log don't have exactly format for problem

**URL:** https://discuss.elastic.co/t/pattern-logstash-to-get-multi-information-in-log-but-log-dont-have-exactly-format-for-problem/70742
**Category:** Logstash
**Created:** [January 6, 2017, 2:38am UTC](https://discuss.elastic.co/t/pattern-logstash-to-get-multi-information-in-log-but-log-dont-have-exactly-format-for-problem/70742 "2017-01-06T02:38:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Tr\_ng\_Trang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tr_ng_trang/32/13053_2.png) [@Tr\_ng\_Trang](https://discuss.elastic.co/u/Tr_ng_Trang)
#### Post date: [January 6, 2017, 2:38am UTC](https://discuss.elastic.co/t/pattern-logstash-to-get-multi-information-in-log-but-log-dont-have-exactly-format-for-problem/70742/1 "2017-01-06T02:38:39Z")

</div>

I have problem to write pattern to get information on logstash, after **[severity "CRITICAL"]** i want to get all word have tag before like [tag "language-multi"] [tag "platform-multi"] i will get **language-multi** and **platform-multi** but i don't exactly number of tag word, and i just want to get information after tag, if after ver like **[ver "OWASP\_CRS/3.0.0"]** i will dont get.  
can solution for my problem?  
thanks you all.

```
[severity "CRITICAL"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-generic"] [hostname "10.84.86.187"] [uri "/"] [unique_id "WGTACH8AAAEAAEQ0krkAAAAQ"]
 [severity "CRITICAL"] [ver "OWASP_CRS/3.0.0"] [maturity "1"] [accuracy "8"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-sqli"] [tag "OWASP_CRS/WEB_ATTACK/SQL_INJECTION"] [tag "WASCTC/WASC-19"] [tag "OWASP_TOP_10/A1"] [tag "OWASP_AppSensor/CIE1"] [tag "PCI/6.5.2"] [hostname "10.84.86.187"]
```

---

<div class="post-metadata">

### Author: ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)
#### Post date: [January 6, 2017, 4:10am UTC](https://discuss.elastic.co/t/pattern-logstash-to-get-multi-information-in-log-but-log-dont-have-exactly-format-for-problem/70742/2 "2017-01-06T04:10:46Z")

</div>

Then your going to want to split the line

since your format is pretty well formated it should be easy.

I am thinking of something like the following

Use the kv plugin to just split everything in to different fields, don't worry about the actual data you want, parse it all and then you can go from there.

[https://www.elastic.co/guide/en/logstash/current/plugins-filters-kv.html#plugins-filters-kv-value\_split](https://www.elastic.co/guide/en/logstash/current/plugins-filters-kv.html#plugins-filters-kv-value_split)

```auto
filter {
  kv {
    field_split => "\]\["
    value_split => "\ "
  }
}

```

---

<div class="post-metadata">

### Author: ![Tr\_ng\_Trang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tr_ng_trang/32/13053_2.png) [@Tr\_ng\_Trang](https://discuss.elastic.co/u/Tr_ng_Trang)
#### Post date: [January 6, 2017, 8:32am UTC](https://discuss.elastic.co/t/pattern-logstash-to-get-multi-information-in-log-but-log-dont-have-exactly-format-for-problem/70742/3 "2017-01-06T08:32:49Z")

</div>

thanksyou friend, i will check it.

---

<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: [February 3, 2017, 8:32am UTC](https://discuss.elastic.co/t/pattern-logstash-to-get-multi-information-in-log-but-log-dont-have-exactly-format-for-problem/70742/4 "2017-02-03T08:32:50Z")

</div>

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