Splunk Search

How to replace description into timechart results

wieslaww
Engager

Splunk Enterprise 7.2.0

I have my query:

index="_itrospection" component ="hostwide" | timechart max(data.mem.mem_used) as Current by splunk_server

In the legend I see the splunk_server descriptions based on hostnames.

I created lookup indexers.csv:
indexer,site
hostname1,Site-1
hostname2,Site-2

How can I use lookup to replace splunk_server fields by lookup field site?

Tags (1)
0 Karma
1 Solution

wieslaww
Engager

Grate, it is working fine.

My mistake was:

index="_introspection" component ="hostwide"
| lookup indexers indexer as splunk_server OUTPUT indexer as splunk_server
| timechart max(data.mem.mem_used) as Current by splunk_server

View solution in original post

0 Karma

wieslaww
Engager

Grate, it is working fine.

My mistake was:

index="_introspection" component ="hostwide"
| lookup indexers indexer as splunk_server OUTPUT indexer as splunk_server
| timechart max(data.mem.mem_used) as Current by splunk_server

0 Karma

niketn
Legend

Hi @wieslaww do you have 1 to 1 mapping between host name and Site or not?

If so, create a Lookup Definition for indexers.csv and then change the query as following:

index="_introspection" component ="hostwide" 
| lookup indexers indexer as splunk_server OUTPUT site 
| timechart max(data.mem.mem_used) as Current by site
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...