Dashboards & Visualizations

How to declare the timerange in a splunk report, which will be generate once a week?

ganinurceski
Engager

Hello there

There is a report, which shows some useful informations about some Application. Whatever.
Now I want to declare in the the report the timerange (last week, example 03.02.2020 00;00 until 10.02.2020 00:00). Or maybe there is possibility to declare the timerange in the description of the report, like a variable or something like that.

Here is my string, maybe i can build in something:

index=smsc tag=MPRO_PRODUCTION DATA="8000000400000000" OR "8000000400000058"
| dedup DATA
| chart count by SHORT_ID, command_status_code
| search NOT ESME_RTHROTTLED=0
| eval "THROTTLING %"=(ESME_RTHROTTLED/(ESME_RTHROTTLED + ESME_ROK)*100)
| sort - ESME_RTHROTTLED
| head 15

Thanks for your help!

0 Karma

to4kawa
Ultra Champion
| addinfo
| eval timerange = "(".strftime(info_min_time, "%d/%m/%Y %T")." - ".strftime(info_max_time, "%d/%m/%Y %T").")"

try $result.timerange$
cf. addinfo

0 Karma

manjunathmeti
Champion

You can use information tokens in the subject or message.

$job.earliestTime$ 
$job.latestTime$ 
0 Karma

manjunathmeti
Champion

Is this report scheduled? If yes, what is the alert action?

0 Karma

ganinurceski
Engager

Send an email

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Depending your definition of "last week", you could use

index=smsc tag=MPRO_PRODUCTION DATA="8000000400000000" OR "8000000400000058" earliest=-1w@w latest=@w

or

index=smsc tag=MPRO_PRODUCTION DATA="8000000400000000" OR "8000000400000058" earliest=-7d@d latest=@d
---
If this reply helps you, Karma would be appreciated.
0 Karma

ganinurceski
Engager

And where this information about the timerange appear? maybe in the filename?

0 Karma

ganinurceski
Engager

I've picked the right timerange with the picker. I just want to remark it in the report, so that we can see, when this events happend.

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!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...