Splunk Enterprise

Dropdown and input options on output which is obtained using join command

supriyagaw08
Explorer

Hi All,

I am trying to add dropdown on workname but output always comes as no records found although that workname is present in the dashboard output.

Below is my code:

$Env$ sourcetype = s $field2$$input$
| table XMIT_NM,USER_NM,WORK_ID,FILE_NM,FILE_ID
| join
[ search $Env$ sourcetype=b
| table WORK_ID WORK_NM ]
| table XMIT_NM,USER_NM,WORK_NM,FILE_NM,FILE_ID

Below is my XML:
<input type="dropdown" token="field2" searchWhenChanged="true">
<label>Search</label>
<choice value="&quot;*&quot;">Any</choice>

<choice value="USER_NM">username</choice>
<choice value="WORK_NM">Work name</choice>
<default>"*"</default>
<initialValue>"*"</initialValue>


I have tried <choice value="WORK_NM=">Work name</choice> and <choice value="&quot;WORK_NM&quot;">Work name</choice> as well but its not working but search using USER_NM is working fine, please suggest is it due to WORK_NM is output from join command and hence it cannot be used or any other ways to make this work.

 

Tags (1)
0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @supriyagaw08,

If WORK_NM is only exist on sub-search that is why your "field2" token filters everything on the first search.

It will make Splunk search/join more events but below may work;

$Env$ sourcetype = s 
| table XMIT_NM,USER_NM,WORK_ID,FILE_NM,FILE_ID
| join
[ search $Env$ sourcetype=b
| table WORK_ID WORK_NM ]
| search $field2$$input$
| table XMIT_NM,USER_NM,WORK_NM,FILE_NM,FILE_ID

 

If this reply helps you an upvote is appreciated. 

If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

supriyagaw08
Explorer

Any help on this will be appreciated, thanks.

0 Karma
Get Updates on the Splunk Community!

Fall Into Learning with New Splunk Education Courses

Every month, Splunk Education releases new courses to help you branch out, strengthen your data science roots, ...

Super Optimize your Splunk Stats Searches: Unlocking the Power of tstats, TERM, and ...

By Martin Hettervik, Senior Consultant and Team Leader at Accelerate at Iver, Splunk MVPThe stats command is ...

How Splunk Observability Cloud Prevented a Major Payment Crisis in Minutes

Your bank's payment processing system is humming along during a busy afternoon, handling millions in hourly ...