Dashboards & Visualizations

Multiselect Tstats Tokens

robertlynch2020
Influencer

Hi

I am trying to apply a Multiselect into a token.
For example, I can change the value of MXTIMING.NPID to the PID 123 and it works - so that is one value.
What I want to do is activate a Multiselect on this token so I can select 123 and 345 and 345, etc. ...

I have tried to add in a prefix of OR but it's not working.

INITIAL - Query

    <query>| tstats summariesonly=$summariesonly_token$ avg(MXTIMING.Elapsed) AS average FROM datamodel=MXTIMING_TEST WHERE 
               host=$host_token$ 
    AND MXTIMING.source_path = *$source_path_search_token$ 
    AND MXTIMING.UserName2=$MXTIMING_UserName_token$ 
    AND MXTIMING.NPID=*$MXTIMING_NPID_token$*  
    AND MXTIMING.MXTIMING_TYPE_DM=$MXTIMING_TYPE_TOKEN$ 
    AND MXTIMING.Context+Command = *$MXTIMING_Context_token$#*
    AND MXTIMING.Context+Command = *#$MXTIMING_Command_token$*
    AND MXTIMING.Time = *
    GROUPBY MXTIMING.Context+Command MXTIMING.NPID MXTIMING.Time 

I tried to add in a way to use OR, but i cant seem to find a way - to me this would be the best way

  <query>| tstats summariesonly=$summariesonly_token$ avg(MXTIMING.Elapsed) AS average FROM datamodel=MXTIMING_TEST WHERE 
                   host=$host_token$ 
        AND MXTIMING.source_path = *$source_path_search_token$ 
        AND MXTIMING.UserName2=$MXTIMING_UserName_token$ 
        AND MXTIMING.NPID="1123" OR "11232"  
        AND MXTIMING.MXTIMING_TYPE_DM=$MXTIMING_TYPE_TOKEN$ 
        AND MXTIMING.Context+Command = *$MXTIMING_Context_token$#*
        AND MXTIMING.Context+Command = *#$MXTIMING_Command_token$*
        AND MXTIMING.Time = *
        GROUPBY MXTIMING.Context+Command MXTIMING.NPID MXTIMING.Time 

In the end i have to change the TOKEN to equal the full string repeating it self [], however this is long and if i want to use this token again i will have to strip out the token value prefix = MXTIMING.NPID

    <query>| tstats summariesonly=$summariesonly_token$ avg(MXTIMING.Elapsed) AS average FROM datamodel=MXTIMING_TEST WHERE 
               host=$host_token$ 
    AND MXTIMING.source_path = *$source_path_search_token$ 
    AND MXTIMING.UserName2=$MXTIMING_UserName_token$ 
  MXTIMING.NPID=10025 OR MXTIMING.NPID=10784 OR MXTIMING.NPID=11858 OR MXTIMING.NPID=12170  
    AND MXTIMING.MXTIMING_TYPE_DM=$MXTIMING_TYPE_TOKEN$ 
    AND MXTIMING.Context+Command = *$MXTIMING_Context_token$#*
    AND MXTIMING.Context+Command = *#$MXTIMING_Command_token$*
    AND MXTIMING.Time = *
    GROUPBY MXTIMING.Context+Command MXTIMING.NPID MXTIMING.Time 
0 Karma
1 Solution

robertlynch2020
Influencer

Hi

I fond an answer to this

MXTIMING.NPID IN (10025 10948 11858)

boom 🙂

View solution in original post

0 Karma

robertlynch2020
Influencer

Hi

I fond an answer to this

MXTIMING.NPID IN (10025 10948 11858)

boom 🙂

0 Karma
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...