# Logstash filter customize

**URL:** https://discuss.elastic.co/t/logstash-filter-customize/96903
**Category:** Logstash
**Created:** [August 14, 2017, 5:10am UTC](https://discuss.elastic.co/t/logstash-filter-customize/96903 "2017-08-14T05:10:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![abu.sayeed](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@abu.sayeed](https://discuss.elastic.co/u/abu.sayeed)
#### Post date: [August 14, 2017, 5:10am UTC](https://discuss.elastic.co/t/logstash-filter-customize/96903/1 "2017-08-14T05:10:37Z")

</div>

my data type:

[INFO] status =\> FAIL | client : [MTB] | cell : [1746710009] | message\_delivery\_time : [2017-08-07 09:46:27,807] | operator: [GP]  
[INFO] status =\> SENT | client : [IPDC] | cell : [1746710009] | message\_delivery\_time : [2017-08-07 09:46:27,807] | operator: [ROBI]

I need discovery available field  
Host:  
status:  
client:  
operator:  
message\_delivery\_time:

how can I write logstash filter?  
Please anybody help me  
thanks

---

<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 14, 2017, 5:28am UTC](https://discuss.elastic.co/t/logstash-filter-customize/96903/2 "2017-08-14T05:28:44Z")

</div>

You have two options:

- Use a grok filter to extract all the fields you're interested in. If you don't know regular expressions you can get help from the grok constructor web site.
- Use a grok filter to separate "[INFO] status =\> fail" from the rest of the string, which is instead passed to a kv filter.

The latter is more flexible and tolerant against changes in the log message.

---

<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 11, 2017, 5:28am UTC](https://discuss.elastic.co/t/logstash-filter-customize/96903/3 "2017-09-11T05:28:57Z")

</div>

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