Splunk Search

Parsing and grouping with

ajitsd
Explorer

I am trying to find an hourly count of the content in Apache access log.

10.113.76.13 - - [16/Nov/2011:17:13:59 -0800] 0 "POST /ApacheApp/default/GetCustomers/1.0 HTTP/1.1" 200 2360
10.113.76.13 - - [16/Nov/2011:17:13:51 -0800] 0 "POST /ApacheApp/default/GetLicenseInfo/1.0 HTTP/1.1" 500 1141
    10.113.76.13 - - [16/Nov/2011:17:14:59 -0800] 0 "POST /ApacheApp/default/GetCustomers/1.0 HTTP/1.1" 200 2360

I want to count frequency of each POST operation string in the following format:

    Hour                                 Service                         Count
1/15/11 5:00:00.000             /default/GetCustomers/1.0                   2
1/15/11 5:00:00.000             /default/GetLicenseInfo/1.0                 1

I tried using timechart option, but I am unsure of how to group these by the pattern in addition to the hour. Does anyone have any ideas?

Tags (2)
0 Karma

Takajian
Builder

Is the following command for your requirement? If you want to change time span, please use span option of timechart command. 1h means 1hours. 30m means 30 minutes. Hope this help.

sourcetype="YourSourcetype" | timechart span=1h count by Service

0 Karma

Takajian
Builder

You need to extract "Service" field from raw string. Regarding how to extact the field, you can see following. Hope this help
:-)

http://docs.splunk.com/Documentation/Splunk/latest/User/InteractiveFieldExtractionExample

0 Karma

ajitsd
Explorer

I had done the same query you have mentioned. My main question was about how to extract the "Service" from the raw string?

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...