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 Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...