Dashboards & Visualizations

Dynamic Table Filtering with Varying Field Names

mattfunk20
Explorer

Hi all! 
I've populated a table dynamically based on a drop down a user can manipulate using... 

 

| inputlookup 
    [| rest /services/saved/searches 
    | fields title 
    | search title=*$userInput$*.c 
    | eval check=replace(title,"\.c",".csv") 
    | return $check] 

 

Additionally I can extrapolate each column into a dropdown using...

 

| inputlookup 
    [| rest /services/saved/searches 
    | fields title 
    | search title=*$userInput$*.c 
    | eval check=replace(title,"\.c",".csv") 
    | return $check] 
| eval value= 
    [| inputlookup 
        [| rest /services/saved/searches 
        | fields title 
        | search title=*$userInput$*.c 
        | eval check=replace(title,"\.c",".csv") 
        | return $check] 
    | transpose 
    | fields column 
    | streamstats count(column) as order 
    | where order = 2 
    | return $column] 
| fields value 
| table value 
| stats values(value) as value 
| mvexpand value

 

by varying order = # 

The issue I'm running into now is pairing the drop down,  the drop down with a set token of "filter1"
Run within 

 

| inputlookup 
    [| rest /services/saved/searches 
    | fields title 
    | search title=*$userInput$*.c 
    | eval check=replace(title,"\.c",".csv") 
    | return $check] 
| search
    [| inputlookup 
        [| rest /services/saved/searches 
        | fields title 
        | search title=*$userInput$*.c 
        | eval check=replace(title,"\.c",".csv") 
        | return $check] 
    | head 1 
    | table * 
    | transpose 
    | head 1 
    | return $column] = $filter1$

 

 

The token is not functioning and will not populate in the query, while other tokens will. I've additionally confirmed the query works, just not when used with tokens within a dashboard. 

To summarize, the overall goal is to provide 4-6 drop downs and a table. Based on the initial user request, this table would populate with data, and each drop down would then be able to further filter data,  with the field names and values all varying.

If something isn't clear please ask and I'd be glad to provide, been banging my head against this one for awhile lol.

Labels (2)
0 Karma
1 Solution

mattfunk20
Explorer

I was able to resolve this via hidden searches within a dashboard. 
I tokenized the lookup table based on a user dropdown, which then ran ~5 searches based on that, returning the tokenized objects I needed.

View solution in original post

0 Karma

mattfunk20
Explorer

I was able to resolve this via hidden searches within a dashboard. 
I tokenized the lookup table based on a user dropdown, which then ran ~5 searches based on that, returning the tokenized objects I needed.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Have you tried using token modifiers?

| return $column] = $filter1|s$
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...