Splunk Enterprise Security

i want to display the time intearval today and last 30 days i want to display the difference between these to days how we can wright query

mahendra559
New Member

| mstats c(System.System_Up_Time) as Uptime prestats=t WHERE index="em_metrics" AND host="*" by host,metric_name span=1m
| where Uptime < (now() - 2160000)
| eval diff=tostring(now() - Uptime,"duration")
| fields host Uptime diff
| sort – Uptime

getting no result
i have 2 hosts one host is coming metric log(System.System_Up_Time) other host is not coming so i want to display it as down

0 Karma

to4kawa
Ultra Champion

please try line by line.
getting no result
where?

| mstats c(System.System_Up_Time) as Uptime prestats=t WHERE index="em_metrics" AND host="*" by host,metric_name span=1m
| inputlookup append=t hostname.csv
| fillnull Uptime
| where Uptime < (now() - 2160000)
| eval diff=tostring(now() - Uptime,"duration")
| fields host Uptime diff
| sort – Uptime

hostname.csv

host
HostA
HostB

Like This?

0 Karma
Get Updates on the Splunk Community!

Video | Tom’s Smartness Journey Continues

Remember Splunk Community member Tom Kopchak? If you caught the first episode of our Smartness interview ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud? Learn how unique features like ...

Leverage Cisco Talos Threat Intelligence Across Splunk Security Products

Leverage Cisco Talos Threat Intelligence Across Splunk Security Products   Security Edition   Have you ...