<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to create a filter on the field fetch using REX? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-filter-on-the-field-fetch-using-REX/m-p/685807#M233990</link>
    <description>&lt;P&gt;Where doesn't support wildcards in this way, try using search instead of where&lt;/P&gt;</description>
    <pubDate>Mon, 29 Apr 2024 11:47:44 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2024-04-29T11:47:44Z</dc:date>
    <item>
      <title>How to create a filter on the field fetch using REX?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-filter-on-the-field-fetch-using-REX/m-p/685788#M233982</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me to find a way to create a Dropdown Input on the field which is extracted using a REX command.&lt;/P&gt;&lt;P&gt;Example: For the below search, I want to add a new dropdown Input with the 3 values :&amp;nbsp;&lt;BR /&gt;a) Incoming b) Outgoing c) Both&amp;nbsp;&lt;/P&gt;&lt;P&gt;If user select Incoming, only those records with the direction as incoming will be displayed.&lt;/P&gt;&lt;P&gt;If user select Outgoing, only those records with the direction as Outgoing will be displayed.&lt;/P&gt;&lt;P&gt;If user select&amp;nbsp;Both, all the records (Direction as incoming or outgoing) will be displayed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Query:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;index=events_prod_cdp_penalty_esa source="SYSLOG" sourcetype=zOS-SYSLOG-Console (TERM(VV537UP) OR TERM(VVF119P) ) ("- ENDED" OR "- STARTED" OR "PURGED --")&lt;BR /&gt;| rex field=TEXT "((VV537UP -)|(VVF119P -))(?&amp;lt;Func&amp;gt;[^\-]+)"&lt;BR /&gt;| fillnull Func value=" PURGED"&lt;BR /&gt;| eval Function=trim(Func)&lt;BR /&gt;| eval DAT = strftime(relative_time(_time, "+0h"), "%d/%m/%Y")&lt;BR /&gt;| rename DAT as Date_of_reception&lt;BR /&gt;| eval {Function}_TIME=_time&lt;BR /&gt;| stats values(Date_of_reception) as Date_of_reception values(*_TIME) as *_TIME by JOBNAME&lt;BR /&gt;| eval Description= case('JOBNAME' == "$VVF119P", "Reception of the CFI file from EB and trigger planning PVVZJH." ,&lt;BR /&gt;'JOBNAME' == "$VV537UP", "Unload of VVA537 for Infocentre." ,&lt;BR /&gt;1=1,"NA")&lt;BR /&gt;| eval &lt;STRONG&gt;DIRECTION&lt;/STRONG&gt;= case('JOBNAME' == "$VVF119P", "INCOMING" , 'JOBNAME' == "$VV537UP", "OUTGOING" ,&lt;BR /&gt;1=1,"NA")&lt;BR /&gt;| eval Diff=ENDED_TIME-STARTED_TIME&lt;BR /&gt;| eval TimeDiff=now() - STARTED_TIME&lt;BR /&gt;| eval Status =&lt;BR /&gt;if(isnotnull(ENDED_TIME) AND (Diff&amp;lt;=120),"OK",if(isnotnull(ENDED_TIME) AND (Diff&amp;gt;120),"BREACHED",&lt;BR /&gt;if(isnull(ENDED_TIME) AND isnull(STARTED_TIME),"PLANNED",if(isnull(ENDED_TIME) AND isnotnull(STARTED_TIME) AND (TimeDiff&amp;gt;1000),"FAILED",&lt;BR /&gt;if(isnull(ENDED_TIME) AND isnotnull(STARTED_TIME) and (TimeDiff&amp;gt;1000),"RUNNING","WARNING")))))&lt;BR /&gt;| fieldformat STARTED_TIME=strftime((STARTED_TIME),"%H:%M:%S")&lt;BR /&gt;| fieldformat ENDED_TIME=strftime((ENDED_TIME),"%H:%M:%S")&lt;BR /&gt;| fieldformat PURGED_TIME=strftime( PURGED_TIME,"%H:%M:%S")&lt;BR /&gt;| eval diff_time = tostring(Diff , "duration")&lt;BR /&gt;| eval diff_time_1=substr(diff_time,1,8)&lt;BR /&gt;| rename diff_time_1 as EXECUTION_TIME&lt;BR /&gt;| table JOBNAME,Description,DIRECTION , Date_of_reception ,STARTED_TIME , ENDED_TIME , PURGED_TIME , EXECUTION_TIME , Status&lt;BR /&gt;| sort -STARTED_TIME&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 10:34:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-filter-on-the-field-fetch-using-REX/m-p/685788#M233982</guid>
      <dc:creator>Real_captain</dc:creator>
      <dc:date>2024-04-29T10:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a filter on the field fetch using REX?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-filter-on-the-field-fetch-using-REX/m-p/685792#M233984</link>
      <description>&lt;P&gt;I am not sure where rex comes into it - you could set up a static drop down like this&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Label&lt;/TD&gt;&lt;TD width="50%"&gt;Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Incoming&lt;/TD&gt;&lt;TD width="50%"&gt;| where DIRECTION=="INCOMING"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Outgoing&lt;/TD&gt;&lt;TD width="50%"&gt;| where DIRECTION=="OUTGOING"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Both&lt;/TD&gt;&lt;TD width="50%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Then just place the token in your search after the DIRECTION eval&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval DIRECTION= case('JOBNAME' == "$VVF119P", "INCOMING" , 'JOBNAME' == "$VV537UP", "OUTGOING" ,
1=1,"NA")
$direction_selector_token$
| eval Diff=ENDED_TIME-STARTED_TIME&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 10:44:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-filter-on-the-field-fetch-using-REX/m-p/685792#M233984</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-04-29T10:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a filter on the field fetch using REX?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-filter-on-the-field-fetch-using-REX/m-p/685802#M233988</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry, I want to create an input (free text) on the field "&lt;SPAN&gt;JOBNAME" which is extracted via rex.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is it possible?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Below input is working fine when I put a job name in the &lt;STRONG&gt;free_text&lt;/STRONG&gt; input but when i give nothing or * in the&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;free_text&lt;/STRONG&gt; input , it gives me no result.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;input type="text" token="free_text" searchWhenChanged="true"&amp;gt;
&amp;lt;label&amp;gt;Free_Text&amp;lt;/label&amp;gt;
&amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
&amp;lt;prefix&amp;gt;| where JOBNAME = "&amp;lt;/prefix&amp;gt;
&amp;lt;suffix&amp;gt;"&amp;lt;/suffix&amp;gt;
&amp;lt;initialValue&amp;gt;*&amp;lt;/initialValue&amp;gt;
&amp;lt;/input&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Any way to create an input filter as a free text for the field JOBNAME ??&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I am using Free text input because there are more than 500 jobs and in the dropdown it does not look good.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 12:16:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-filter-on-the-field-fetch-using-REX/m-p/685802#M233988</guid>
      <dc:creator>Real_captain</dc:creator>
      <dc:date>2024-04-29T12:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a filter on the field fetch using REX?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-filter-on-the-field-fetch-using-REX/m-p/685807#M233990</link>
      <description>&lt;P&gt;Where doesn't support wildcards in this way, try using search instead of where&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 11:47:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-filter-on-the-field-fetch-using-REX/m-p/685807#M233990</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-04-29T11:47:44Z</dc:date>
    </item>
  </channel>
</rss>

