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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...