Splunk Search

How to pass a token in base search?

restinlinux
Explorer

i want to pass the input token to my base search.

In the panel its shows no results found, but when try click on "open in search" i can able to find the result.

whats the issue here?

 

<fieldset submitButton="false">
<input type="dropdown" token="Month">
<label>Month</label>
<fieldForLabel>date</fieldForLabel>
<fieldForValue>date</fieldForValue>
<search>
<query>| inputlookup test.csv
| table date</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>

<search id="bs1">

<query>index=xyz source=*.csv |eval Date="$Month$"|eval Date1=date_year + date_month |where Date1=Date |lookup test.csv date as Date OUTPUT source as Source |where source=Source</query>
<earliest>0</earliest>
<latest></latest>
</input>
</fieldset>

panel>
<single>
<title>PRODUCTION</title>
<search base="bs1">
<query>|search me |stats sum(me) as i </query>
</search>
<option name="drilldown">none</option>
<option name="refresh.display">progressbar</option>
</single>

 

0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @restinlinux,

if in a base search you don't use a streaming command as stats or timechart, you have to use the fields command to list all the fields to use in the panels.

In your case, in the panel you have the field "me" that isn't listed in the base search so you have to add the fields command with al the fields to use in panels (me, etc...):

index=xyz source=*.csv 
| eval Date="$Month$", Date1=date_year+date_month 
| where Date1=Date 
| lookup test.csv date as Date OUTPUT source as Source 
| where source=Source
| fields me

 Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @restinlinux,

if in a base search you don't use a streaming command as stats or timechart, you have to use the fields command to list all the fields to use in the panels.

In your case, in the panel you have the field "me" that isn't listed in the base search so you have to add the fields command with al the fields to use in panels (me, etc...):

index=xyz source=*.csv 
| eval Date="$Month$", Date1=date_year+date_month 
| where Date1=Date 
| lookup test.csv date as Date OUTPUT source as Source 
| where source=Source
| fields me

 Ciao.

Giuseppe

Get Updates on the Splunk Community!

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco &#43; Splunk! We’ve ...