# Kv filter seems to be working

**URL:** <https://discuss.elastic.co/t/kv-filter-seems-to-be-working/197259>\
**Category:** Logstash\
**Created:** [August 29, 2019, 4:55am UTC](https://discuss.elastic.co/t/kv-filter-seems-to-be-working/197259 "2019-08-29T04:55:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abed\_Bishara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abed_bishara/32/41603_2.png) [@Abed\_Bishara](https://discuss.elastic.co/u/Abed_Bishara)\
**Post date:** [August 29, 2019, 4:55am UTC](https://discuss.elastic.co/t/kv-filter-seems-to-be-working/197259/1 "2019-08-29T04:55:38Z")

</div>

Hi

I configured the logstash with kv filter and it is not working  
When I simply add the argument:

```
		kv {
		source => "syslog_message"			
		field_split => " "
	}

```

The logstash stops working and I see no logs in kibana  
When I remove it and restart the services and logs back to work

This is the working argument:

```
if [type] == "forti_log" {
    grok {
      match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" }
      add_field => ["received_at", "%{@timestamp}"]
      add_field => ["received_from", "%{host}"]
    }
syslog_pri { }
    date {
      match => ["syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss"]
    }
  }

```

And this is with the kv , (non working argument)

```
if [type] == "forti_log" {
    grok {
      match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" }
      add_field => ["received_at", "%{@timestamp}"]
      add_field => ["received_from", "%{host}"]
    }
	kv {
		source => "syslog_message"			
		field_split => " "
	}
syslog_pri { }
    date {
      match => ["syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss"]
    }
  }

```

And this is the log I'm receiving from the firewall:

 ![Capture-Kibana](https://us1.discourse-cdn.com/elastic/original/3X/f/8/f8a86146a71519b5fa93ed9ae20f564951726447.png)

What should I do / how should I troubleshoot the issue ?

I'm new to Kibana so I'm sorry in advance if I did a huge mistake posting this 🙂

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Abed\_Bishara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abed_bishara/32/41603_2.png) [@Abed\_Bishara](https://discuss.elastic.co/u/Abed_Bishara)\
**Post date:** [August 29, 2019, 6:19am UTC](https://discuss.elastic.co/t/kv-filter-seems-to-be-working/197259/2 "2019-08-29T06:19:16Z")

</div>

Hi

I solved it.

I saw this post:

> <https://stackoverflow.com/questions/48703747/kv-fiter-not-including-space-values>

And I changed the argument to:

```
if [type] == "forti_log" {
    grok {
      match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" }
      add_field => ["received_at", "%{@timestamp}"]
      add_field => ["received_from", "%{host}"]
    }
mutate {
  gsub => ["message", "(\S+=)", ", \1"]
}
kv {			
field_split => ","
}
syslog_pri { }
    date {
      match => ["syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss"]
    }
  }

```

Work like charm !! 🙂

 ![Capture_fortigate_kibana_new](https://us1.discourse-cdn.com/elastic/original/3X/2/d/2dd7078afcb2e4a72ce79c894eacf4253c041892.png)

---

<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 26, 2019, 6:19am UTC](https://discuss.elastic.co/t/kv-filter-seems-to-be-working/197259/3 "2019-09-26T06:19:57Z")

</div>

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