# Parse apache access log all the fields and draw the graph using status/response

**URL:** <https://discuss.elastic.co/t/parse-apache-access-log-all-the-fields-and-draw-the-graph-using-status-response/173247>\
**Category:** Logstash\
**Created:** [March 21, 2019, 5:00am UTC](https://discuss.elastic.co/t/parse-apache-access-log-all-the-fields-and-draw-the-graph-using-status-response/173247 "2019-03-21T05:00:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mschofield](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@mschofield](https://discuss.elastic.co/u/mschofield)\
**Post date:** [March 21, 2019, 5:00am UTC](https://discuss.elastic.co/t/parse-apache-access-log-all-the-fields-and-draw-the-graph-using-status-response/173247/1 "2019-03-21T05:00:36Z")

</div>

I need to filter status like 200 or response in kibana graph. But available fields like status/response not showing to filter in Discover.

Logstash code :  
input {  
beats {  
port =\> "5044"  
}  
}

filter {  
if [type] == "log" {  
grok {  
match =\> { "message" =\> '%{IPORHOST:clientip} - - [%{DATA:day}/%{WORD:month}/%{YEAR:year}:%{DATA:hour}:%{DATA:minute}:%{DATA:seconds}] "%{WORD:method} %{DATA:url} HTTP/%{NUMBER:http\_version}" %{DATA:status} %{DATA:response} "%{DATA:referurl}" "%{WORD:client}/%{DATA:clinet\_version}"'  
}  
remove\_field =\> "message"  
}  
}  
}

output {  
elasticsearch {  
hosts =\> "localhost:9200"  
manage\_template =\> false  
index =\> "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"  
}  
}

Ouput in Kibana Discover :

message 192.168.1.199 - - [21/Mar/2019:09:22:23 +0530] "GET / HTTP/1.1" 403 4961 "-" "avast! Antivirus"

But the above log combined into single field, i need a separate field like clientip/  
status/resposne

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 22, 2019, 12:49pm UTC](https://discuss.elastic.co/t/parse-apache-access-log-all-the-fields-and-draw-the-graph-using-status-response/173247/2 "2019-03-22T12:49:59Z")

</div>

> [@mschofield](#):
>
> grok {  
> match =\> { "message" =\> '%{IPORHOST:clientip} - - [%{DATA:day}/%{WORD:month}/%{YEAR:year}:%{DATA:hour}:%{DATA:minute}:%{DATA:seconds}] "%{WORD:method} %{DATA:url} HTTP/%{NUMBER:http\_version}" %{DATA:status} %{DATA:response} "%{DATA:referurl}" "%{WORD:client}/%{DATA:clinet\_version}"'  
> }

You example line does not match your grok Pattern. For example. "avast! Antivirus" does not match "%{WORD:client}/%{DATA:clinet\_version}".

Try

```
match => { "message" => '^%{IPORHOST:clientip} - - \[%{DATA:ts}\] "%{WORD:method} %{DATA:url} HTTP/%{NUMBER:http_version}" %{DATA:status} %{DATA:response} "%{DATA:referurl}" "%{DATA:client}"' }

```

---

<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:** [April 19, 2019, 12:50pm UTC](https://discuss.elastic.co/t/parse-apache-access-log-all-the-fields-and-draw-the-graph-using-status-response/173247/3 "2019-04-19T12:50:00Z")

</div>

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