Dashboards & Visualizations

Dashboard search token

becksyboy
Contributor

Hi All,

im trying to learn about search tokens within the same dashboard, but not having much luck. I've set up a simple test dashboard with two panels, both are tables. I would like a search token defined for search A and used in search B for the RecordNumber field. Is it possible without a field input shown on the dashboard?

Search A:
index="wineventlog" LogName=Security | table EventCode RecordNumber

Search B:
index="wineventlog" LogName=Security RecordNumber=* | dedup RecordNumber| table RecordNumber

thanks

Tags (1)
0 Karma
1 Solution

493669
Super Champion

you can use drilldown in first table like:

 <drilldown>
          <condition field="RecordNumber">
            <set token="selected_RecordNumber">$click.value2$</set>
          </condition>
 </drilldown>

then use $selected_RecordNumber$ token in second table query like:

index="wineventlog" LogName=Security RecordNumber=$selected_RecordNumber$ | dedup RecordNumber| table RecordNumber

View solution in original post

0 Karma

niketn
Legend

@becksyboy, intent of your Search A and Search B is not clear.

The Search A in the question returns All Events and All RecorNumbers (even duplicates). What is the purpose or the intent of this?

The Search B returns all unique RecordNumbers.

Please clarify the question as well I would like a search token defined for search A and used in search B for the RecordNumber field. Is it possible without a field input shown on the dashboard?. What do you want to do here?

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

493669
Super Champion

you can use drilldown in first table like:

 <drilldown>
          <condition field="RecordNumber">
            <set token="selected_RecordNumber">$click.value2$</set>
          </condition>
 </drilldown>

then use $selected_RecordNumber$ token in second table query like:

index="wineventlog" LogName=Security RecordNumber=$selected_RecordNumber$ | dedup RecordNumber| table RecordNumber
0 Karma

becksyboy
Contributor

Thanks Rajesh, i could only get this to work if i set search A with the drilldown option name to cell. So if i click on a RecordNumber from the Search A table, the value is shown in the Search B table. Is there a way to dynamically show all the results for the table in Search B>?

0 Karma

493669
Super Champion

Dynamically show all the results means? can you explain in detail that on click on table A what you are expecting in tableB

0 Karma

becksyboy
Contributor

Hi, i was hoping to see my table populated with results for all rows. Is that possible with a search token?

0 Karma

493669
Super Champion

can you provide sample table A and expected table B to get better understanding

0 Karma

becksyboy
Contributor

I suppose my example searches are more for a learning/understanding point of view, so perhaps they may not be the best. However, below are the tables i have on my test dashboard. So can a search token power search B to show all rows?

Search A:
EventCode RecordNumber
4624 9000
4624 9000
4624 9000
4624 9001

Search B:
RecordNumber
9000
9001
9002
9003

0 Karma

493669
Super Champion

basically drilldown can be used to sort the results but here you are expecting full result set with only one column with unique value . so write below query in tableB

 index="wineventlog" LogName=Security  | dedup RecordNumber| table RecordNumber

but if you want this table B to be shown only after clicking on Table A then you can use depends in <panel>
firstly use below drilldown in tabelA panel:

<drilldown>
          <set token="count_field">$click.value$</set>
 </drilldown>

and now in second panel use depends:

<panel depends="$count_field$">
0 Karma

becksyboy
Contributor

Thanks Rajesh, this making sense; i'm getting a better understanding of this now.

0 Karma

becksyboy
Contributor

Thanks somesoni2 i've been reading these docs, very helpful, with alot to pick through and understand.

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!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...