Dashboards & Visualizations

Fields as variables

ARaman77
Explorer

I have a question, in microservice based platform where are getting several logs for the different application. Each application tracks unique transactions via a id, either a CorrelationId, SessionId, transactionid

I want to be able to put this is a lookup application.csv file and use it for same dashboard

so my lookup will look like

Application SourceLogs Unique_Identifier
App1 Application1.logs CorrelationId
App2 Application2.logs SessionId
App3 Application3.logs TransactionId


I have created a input where the user can select the Application via tkn_app


index=application_logs
| lookup application.csv SourceLogs as source | search Application=$tkn_app$
| bin span=5m _time
| stats dc(Unique_Identifier) AS TPS by _time


however this searches for Correlationid , SessionId and TransactionId and not the actual values, how to I make it so Unique_Identfier searches for the right metadata

 

Note the logs are in json format, so the fields Correlationid , SessionId and TransactionId are autodetected by Splunk

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The search command does not support field names on the right of the = - it assumes the right side is a string.

Try using where, instead.

---
If this reply helps you, Karma would be appreciated.
0 Karma

ARaman77
Explorer

My question is not on the search string, my question is how to use field like CorrelationID, SessionID or TransactionID as a variable

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The question is not about the search command, but the answer is.  The existing query will not treat anything on the right side of = as a field ("variable").  Use the variable in a where command and it should work.

---
If this reply helps you, Karma would be appreciated.
0 Karma

ARaman77
Explorer

I did use the where clause and it dint work

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...