# Logstash filter for akamai logs

**URL:** <https://discuss.elastic.co/t/logstash-filter-for-akamai-logs/106677>\
**Category:** Logstash\
**Created:** [November 7, 2017, 11:40am UTC](https://discuss.elastic.co/t/logstash-filter-for-akamai-logs/106677 "2017-11-07T11:40:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![giangra](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@giangra](https://discuss.elastic.co/u/giangra)\
**Post date:** [November 7, 2017, 11:40am UTC](https://discuss.elastic.co/t/logstash-filter-for-akamai-logs/106677/1 "2017-11-07T11:40:08Z")

</div>

Hi everyone,  
I have some problem creating a logstash configuration file to parse akamai logs. In my case, Akamai logs are in a FTP server and they don't have the typical .log extension, because they're all zipped (.gz).  
So I've started to create this configuration file:

_input {_  
\_ file {\_  
\_ path =\> "/home/akamailogs/\*.gz"\_  
\_ start\_position =\> "beginning"\_  
\_ codec =\> "gzip\_lines"\_  
\_ type =\> "akamai"\_  
\_ }\_  
_}_

_filter {_  
\_ grok {\_  
\_ match =\> { "message" =\> "%{IP:clientip}\t%{HTTPDATE:timestamp}\t%{WORD:verb}\t%{URIPATHPARAM:request}\t%{NUMBER:httpversion}\t%{NUMBER:response:int}\t%{NUMBER:bytes:int}\t%{URI:referrer}\t%{QS:agent}\t%{QS:cookie}\t%{URIPATHPARAM:cdn\t%{NUMBER:cdnumb:int}" }\_  
\_ }\_  
\_ date {\_  
\_ match =\> ["timestamp", "dd/MMM/yyyy:HH:mm:ss Z"]\_  
\_ }\_  
_}_

_output {_  
\_ elasticsearch {\_  
\_ hosts =\> ["http://\*\*\*\*"]\_  
\_ user =\> "elastic"\_  
\_ password =\> "changeme"\_  
\_ index =\> "akamai\_logs-%{+YYYY-MM-dd}"\_  
\_ }\_  
\_ stdout { codec =\> rubydebug }\_  
_}_

The following example is the log file that I need to parse:

_91.24.8.111 - - [25/May/2017:00:00:00 +0000] "GET /streaming/g244569.mp4?vbegin=3174& **token** =exp=14956112167%7eacl=/streaming/g21343339.mp4%3Fvbegin=3174\*%7ehmac=454fc7e6b547e40656e547efsdasda85ad3b HTTP/1.1" 000 5470467 "-" "AppleCoreMedia/1.0.14 (iPhone; U; CPU OS 10\_3\_1 like Mac OS X; it\_it)" "-" [cdn1.test.com](http://cdn1.test.com) 1707 "-"_

and this is the grok filter I can't run...

_"%{IP:clientip}\t%{HTTPDATE:timestamp}\t%{WORD:verb}\t%{URIPATHPARAM:request}\t%{NUMBER:httpversion}\t%{NUMBER:response:int}\t%{NUMBER:bytes:int}\t%{URI:referrer}\t%{QS:agent}\t%{QS:cookie}\t%{URIPATHPARAM:cdn\t%{NUMBER:cdnumb:int}"_

Any advice? 🙂

---

<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:** [November 9, 2017, 9:58pm UTC](https://discuss.elastic.co/t/logstash-filter-for-akamai-logs/106677/2 "2017-11-09T21:58:46Z")

</div>

What's the problem, exactly?

Do the Akamai logs really have tab characters between each column?

---

<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:** [December 7, 2017, 9:58pm UTC](https://discuss.elastic.co/t/logstash-filter-for-akamai-logs/106677/3 "2017-12-07T21:58:58Z")

</div>

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