Splunk Search

How can I display only 1 value in a timechart that uses a by

Splunked_Kid
Explorer

Hello
how can I display only 1 value of these 3 "maxCapacitMachine" results (which are the same in all 3 cases) in a BY timechart?

Splunked_Kid_0-1729802172670.png

 

Labels (1)
0 Karma
1 Solution

MuS
SplunkTrust
SplunkTrust

Please add this 

 | eval foo=0 | foreach max* [ eval foo='<<FIELD>>'] | fields - max* | rename foo AS max

at the end of your SPL 🙂 

View solution in original post

Splunked_Kid
Explorer

ok but max is a value that I get from the index and not a value that I attribute.  My problem is that the value I get from the index is the same for all 3 LPARs, I only want to display it 1 time.

 

0 Karma

Splunked_Kid
Explorer

Splunked_Kid_0-1729807359663.png

 

0 Karma

MuS
SplunkTrust
SplunkTrust

Please add this 

 | eval foo=0 | foreach max* [ eval foo='<<FIELD>>'] | fields - max* | rename foo AS max

at the end of your SPL 🙂 

Splunked_Kid
Explorer

It works! Thank you very much MuS!

0 Karma

MuS
SplunkTrust
SplunkTrust

Hi there,

if your max value is static, you could do something like this:

index=_internal sourcetype=* | timechart span=1h count by sourcetype | eval max=10000000

and this will produce 1 max line on the graph like this:

MuS_0-1729806614411.png

 

Hope this helps ...

cheers, MuS

0 Karma
Get Updates on the Splunk Community!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...