# Logstash mutate split

**URL:** <https://discuss.elastic.co/t/logstash-mutate-split/88097>\
**Category:** Logstash\
**Created:** [June 2, 2017, 2:07pm UTC](https://discuss.elastic.co/t/logstash-mutate-split/88097 "2017-06-02T14:07:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Man-kyun\_Choi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/man-kyun_choi/32/18752_2.png) [@Man-kyun\_Choi](https://discuss.elastic.co/u/Man-kyun_Choi)\
**Post date:** [June 2, 2017, 2:07pm UTC](https://discuss.elastic.co/t/logstash-mutate-split/88097/1 "2017-06-02T14:07:06Z")

</div>

I installed ELK and try to configured logstash to parse our Web Application FIrewall security log.

The WAF log is below

May 31 13:47:11 2017 WAFK\_TAC (warning) log\_processor: [WEBFRONT/0x00727001] Violated Cross Site Scripting - the form field is not allowed. (log\_id="1882409510",app\_name="default\_app",app\_id="255",src\_if="lan",src\_ip="192.168.204.139",src\_port="58286",dest\_ip="125.209.214.100",dest\_port="80",forwarded\_for="",host="[ts.naver.com](http://ts.naver.com)",url="/t",sig\_warning="user",url\_param="",protocol="http",block="no",evidence\_id="1879446843",owasp="A3",field="bi", sigid="210700002" , data="\r\n")

I want to divide this message like this :

log\_id="1882409510"  
app\_name="default\_app"  
app\_id="255"  
.  
.  
.

my logstash.conf is below

input {  
file {  
path =\> "/var/log/syslog"  
start\_position =\> "beginning"  
}  
}

filter {  
if [path] == "syslog" {  
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 {  
split =\> {"syslog\_message" =\> "="}  
add\_field =\> { "log\_id" =\> "%{[syslog\_message][0]}"  
"app\_name" =\> "%{[syslog\_message][1]}"}  
}

```
date {
  match => ["syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss"]
}

```

}  
}

output {  
elasticsearch { hosts =\> ["127.0.0.1:9200"] }  
stdout { codec =\> rubydebug }

===============================================

But, I can't see new filed.  
I think there is something wrong but I can't find it  
please help me

---

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [June 2, 2017, 4:32pm UTC](https://discuss.elastic.co/t/logstash-mutate-split/88097/2 "2017-06-02T16:32:10Z")

</div>

look at the KV filter or the dissect filter.

---

<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:** [June 30, 2017, 4:32pm UTC](https://discuss.elastic.co/t/logstash-mutate-split/88097/3 "2017-06-30T16:32:24Z")

</div>

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