Dashboards & Visualizations

Earliest is the max(timestamp) from an inputlookup

morethanyell
Builder

We have a job which routinely creates an outputlookup containing the time (timestamp) it has completed a successful summary index.

We'd like to use this information in a dashboard such that the earliest is max(timestamp)

idea:

index=some_index_summary earliest=the max(timestamp) from my inputlookup
0 Karma
1 Solution

woodcock
Esteemed Legend

Doing earliest and latest in a subsearch is tricky and requires special handling, including only using integer values and eliminating double-quotes. Try this for your subsearch; it will work unless timestamp is not a number (it must be a time_t😞

 index=some_index_summary [|inputlookup my_inputlookup | stats max(timestamp) AS earliest
 | format "" "" "" "" "" ""
 | rex field=search mode=sed "s/\"//g"]

View solution in original post

woodcock
Esteemed Legend

Doing earliest and latest in a subsearch is tricky and requires special handling, including only using integer values and eliminating double-quotes. Try this for your subsearch; it will work unless timestamp is not a number (it must be a time_t😞

 index=some_index_summary [|inputlookup my_inputlookup | stats max(timestamp) AS earliest
 | format "" "" "" "" "" ""
 | rex field=search mode=sed "s/\"//g"]

morethanyell
Builder

Thanks a lot. It works.

0 Karma

mstjohn_splunk
Splunk Employee
Splunk Employee

hi @morethanyell

Did the answer below solve your problem? If so, please resolve this post by approving it!
If your problem is still not solved, keep us updated so that someone else can help ya. Thanks for posting!

0 Karma

morethanyell
Builder

it does not work

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@morethanyell

Can you please try this?

 index=some_index_summary  [ | inputlookup mylookup | stats max(timestamp) as earliest | field earliest]
0 Karma

morethanyell
Builder

it does not work.

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...