Dashboards & Visualizations

How to show data for second week of tuesday every month

pavithra
Explorer
 
Labels (2)
0 Karma
1 Solution

emdaax
Explorer

Hi @pavithra

you could try with the ceiling function: ceiling or ceil 

example:

| eval day_of_month=strftime(_time, "%d")
| eval day_of_week=strftime(_time, "%A")
| eval week_of_month=ceil(day_of_month/7)
| where day_of_week="Tuesday" AND week_of_month=2

 
best regards,

View solution in original post

0 Karma

emdaax
Explorer

Hi @pavithra

you could try with the ceiling function: ceiling or ceil 

example:

| eval day_of_month=strftime(_time, "%d")
| eval day_of_week=strftime(_time, "%A")
| eval week_of_month=ceil(day_of_month/7)
| where day_of_week="Tuesday" AND week_of_month=2

 
best regards,

0 Karma

pavithra
Explorer

Thanks!!  Its working

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @pavithra ,

good for you, see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated by all the contributors 😉

emdaax
Explorer

Great, I'm glad to hear that this solution was helpful for your use case 👍
happy splunking and best regards ; )


P.S.: Karma Points are always appreciated 😉

gcusello
SplunkTrust
SplunkTrust

Hi @pavithra 

at first it isn't so clear with timeframe you want to display, but this is inside your search, so if it's the previous month, you could run something like this:

<your_search> earliest=-mon@mon latest=@mon
| stats count BY key

and schedule your search using this cron:

0 0 8-15 * 3

Ciao.

Giuseppe

Get Updates on the Splunk Community!

Announcing the Expansion of the Splunk Academic Alliance Program

The Splunk Community is more than just an online forum — it’s a network of passionate users, administrators, ...

Learn Splunk Insider Insights, Do More With Gen AI, & Find 20+ New Use Cases You Can ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Buttercup Games: Further Dashboarding Techniques (Part 7)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...