Splunk Search

Set chart from 12am to 11.59am ? [search queries]

sbnoobbb
Path Finder

I have this search query sourcetype="CurrentWeatherSGMap" Message="Yishun" | eval Description=case(current_summary="Rain", "Poor",current_summary="Thundery Showers","Poor", current_summary="Cloudy", "Fair", current_summary="Partly Cloudy", "Excellent") | chart dc(Description) over _time by Description | eval Poor=if(Description==Poor, "1", "1"). How can I set the chart to display from 12am to 12am time range daily ?

Or can I use advanced xml to display my result ?

Tags (3)
0 Karma
1 Solution

amit_saxena
Communicator

Hi,

I would suggest using the following in your search.

earliest=@d latest=@d+12

let me know if that works for you.

Regards,
Amit Saxena

View solution in original post

0 Karma

amit_saxena
Communicator

Hi,

I would suggest using the following in your search.

earliest=@d latest=@d+12

let me know if that works for you.

Regards,
Amit Saxena

0 Karma

amit_saxena
Communicator

Hi,
Do confirm it the above solution worked for you ?
Regards,
Amit Saxena

0 Karma

linu1988
Champion

You can explicitly define earlest=-1d@d latest=0d@d if only the previous day's data is to be displayed.

Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...