Dashboards & Visualizations

Dashboard outputting pattern

sarahw3
Explorer

I have events that are statuses of cameras. I want to create a panel that outputs the names of the cameras whose status="Never_Checked" or "No_Images for three days in a row. For example, if camera 1A was never checked on 8/1, 8/2, and 8/3, 1A will be added to a list. Is this possible?

0 Karma

woodcock
Esteemed Legend

Let's make it flexible. If you select Last 3 days then this will check for 3 days as you desire but if you change the timepicker, it will shift.

|gentimes start=-4
| rename starttime AS _time
| fields _time
| streamstats count AS _serial
| eval host="camera1 camera2 camera3 camera4 camera5"
| makemv host
| mvexpand host
| eval status=case(host="camera5", "OK",
                   host="camera1", "Never_Checked",
                   host="camera2", "No_Images",
                   _serial=1, "Never_Checked",
                   _serial=2, "No_Images",
                   _serial=3 AND host="camera3", "No_Images",
                   _serial=3 AND host="camera4", "OK",
                   true(), "No_Images")

| rename COMMENT AS "Everything above generates sample event data; everything below is your solution"

| stats values(status) AS status dc(status) AS statusCount BY host
| where (statusCount=1 AND (status="Never_Checked" OR status="No_Images")) OR (statusCount=2 AND status="Never_Checked" AND status="No_Images")
0 Karma

sbbadri
Motivator

try this

index=xx sourcetype=xxx earliest=-3d@d latest=now status="Never_Checked" OR status="No_Images" | table camera status

I hope status field got extracted from events.

0 Karma

sarahw3
Explorer

It is not showing any events. This could be because I have only put in up to April 2017 this year into splunk. Is there a way I can make it looks at the 3 days before the date that is selected?

0 Karma

sbbadri
Motivator

can you post one sample event

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...