Splunk Search

how to take only monday data for a month

dtccsundar
Path Finder

Hi,

My requirement is to take each week monday data alone for a month in trending chart .

This need to be showed for status field ,which will have ( pass,fail,error,deleted) values in it.The individual count of  status to be shown for each week monday for a month.

Please let me know how to do this .

 

Labels (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @dtccsundar,

date_wday is a default field in Splunk, if you haven't you can extract it in this way from _time:

<your_search>
| eval date_wday=strftime(_time,"%A")
| search date_wday!="Monday"

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @dtccsundar,

did you already tried to insert in your main search:

date_wday="monday"

?

Ciao.

Giuseppe

0 Karma

dtccsundar
Path Finder

Thank you .

Yes tried with earliest=-30d@w1 latest=-d@w1 in my search , but i couldnt get the desired o/p.

I am not seeing the field date_wday in my events , since i am using a sql view as source.How this can be achieved in this case.

 

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @dtccsundar,

please try something like this:

earliest=-30d@d latest=-d@d date_wday="monday"

Ciao.

Giuseppe

0 Karma

dtccsundar
Path Finder

Thank you .

I am getting no results for this .

I have _time field in my events . Is is possible to derive each monday from that ?

Tags (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @dtccsundar,

date_wday is a default field in Splunk, if you haven't you can extract it in this way from _time:

<your_search>
| eval date_wday=strftime(_time,"%A")
| search date_wday!="Monday"

Ciao.

Giuseppe

dtccsundar
Path Finder

Thank you. This worked Perfectly !!

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @dtccsundar,

good for you, see next time!

Ciao and happy splunking.

Giuseppe

P.S.: Karma Points are appreciated 😉

0 Karma

dtccsundar
Path Finder

Hi Giuseppe,

Can you please help me in the below drill down please ,

 

Need help for the below, The sourcetypes has different values in it like below,

 index=a sourcetype=b |eval details= ONE |

append [|search index=c sourcetype=d|eval details=TWO] |

append [|search index=e sourcetype=f|eval details=THREE]

|eventstats count by details| Pass%=count(pass)/total*100,2 Fail%=count(fail)/total*100,2 Error%=count(Error)/total*100,2 |table pass fail error total

I have a barchart with x-axis with details and y-axis %(pass%,fail%,error%) of ( pass fail error etc).

When i click the details(x-axis) in barchart , the trending should show number of individual Pass,fail,error based on the details values selected .

The click values should be passed to the the trending .Please let me know how it can be achieved .

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...