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>

 

Labels (1)
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!

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had 3 releases of new security content via the Enterprise Security ...

Archived Metrics Now Available for APAC and EMEA realms

We’re excited to announce the launch of Archived Metrics in Splunk Infrastructure Monitoring for our customers ...