Splunk Search

How to edit my search so that columns show events per date?

mforgues
Engager

Hi,

I am new to Splunk and I am having a hard time to achieve something I believe is basic.

I am trying to run the following search :

File Done | eval date=strftime(_time,"%Y-%m-%d") | stats count by Region, Operator, date 

and it's returning something like this :

Region  Operator    date    count
RASO    CELCOM  2017-03-23  1
RASO    CELCOM  2017-03-25  2
RASO    CELCOM  2017-03-26  1
RASO    CELCOM  2017-03-28  1
RASO    CELCOM  2017-03-29  1
RASO    DST 2017-03-28  2
RASO    DTAC    2017-03-23  1
RASO    DTAC    2017-03-24  2
RASO    DTAC    2017-03-25  2
RASO    DTAC    2017-03-26  2
RASO    DTAC    2017-03-27  1
RASO    DTAC    2017-03-28  2
RASO    DTAC    2017-03-29  2
RASO    DTN 2017-03-23  1
RASO    DTN 2017-03-24  2
RASO    DTN 2017-03-25  2
RASO    DTN 2017-03-26  2
RASO    DTN 2017-03-27  2
RASO    DTN 2017-03-28  2
RASO    DTN 2017-03-29  2

I would like to know if it's possible to have a column per date

Region  Operator 2017-03-23 2017-03-24 2017-03-25 2017-03-26 2017-03-27 2017-03-28 2017-03-29
RASO    CELCOM      1                       2           1                   1           1
RASO    DST                                                                 2           
RASO    DTAC        1           2           2           2           1       2           2
RASO    DTN     1           2           2           2           2       2           2

Sorry for the bad spacing in my examples... I hope you get the idea.

thanks.

0 Karma

woodcock
Esteemed Legend

Add this to the end of your existing search:

| eval R_O = Region . "::" . Operator
| fields - Region Operator
| xyseries R_O count _time
| rex field=R_O "^(?<Region>.*)::(?<Operator>.*)$"
| fields - R_O
| table Region Operator *
0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...