Splunk Search

Dashboard Panel field concatenation- Can this be done?

auzark
Communicator

Hi,

In the below code for a panel on my dashboard, I am displaying whether a report/alert is being skipped.

If the _time field returned from the lookup.csv is > than 20 minutes ago. I would also like to display the value of _time  as well as the message. Can this be done?

<query>

| inputlookup append=t Lookup.csv
| eval tnow = now()
| eval lastruntime_unix = _time
| eval time_diff = tnow - lastruntime_unix
| eval status=if(time_diff > 1200, "1", "0")
| table status


| rangemap field=status low=0-0 severe=1-5 default=severe
| replace "0" with "Alert Run is Up to Date" in status
| replace "1" with "Alert Run is Skipping" in status

</query>

0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

Use eval to set your status field - so replace from your table status with this

| table status _time
| rangemap field=status low=0-0 severe=1-5 default=severe
| eval status="Alert Run is ".if(status=0, "Up to Date", "Skipping ".strftime(_time, "%F %T"))

 You can change the format of your _time with strftime statement

View solution in original post

auzark
Communicator

Thank You, bowesmana.....

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Use eval to set your status field - so replace from your table status with this

| table status _time
| rangemap field=status low=0-0 severe=1-5 default=severe
| eval status="Alert Run is ".if(status=0, "Up to Date", "Skipping ".strftime(_time, "%F %T"))

 You can change the format of your _time with strftime statement

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...