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!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...