<?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 edit my search to filter results using extracted fields from a lookup and a where clause? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-filter-results-using-extracted-fields/m-p/216937#M63710</link>
    <description>&lt;P&gt;index=xyz sourcetype=xyz:abc | rex field=user "(?:.&lt;EM&gt;\|)(?[\w]&lt;/EM&gt;)" | lookup user AS user OUTPUT title | search title=MD&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jun 2016 18:25:08 GMT</pubDate>
    <dc:creator>ltrand</dc:creator>
    <dc:date>2016-06-22T18:25:08Z</dc:date>
    <item>
      <title>How to edit my search to filter results using extracted fields from a lookup and a where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-filter-results-using-extracted-fields/m-p/216935#M63708</link>
      <description>&lt;P&gt;Hi.  &lt;/P&gt;

&lt;P&gt;How do I filter my results from an extracted field and where-clause?&lt;/P&gt;

&lt;P&gt;I have a user lookup table which contains different formats such as /, , etc.  I am able to extract a new field, but how can I apply it from the Splunk search?&lt;/P&gt;

&lt;P&gt;My sample lookup csv file (users.csv):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;user                       title
-------                    -------------
xyz.com/U1234              MD
X12345                     AVP
P12345                     ED
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My lookup object configuration (transforms.conf):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[userid_lookup]
filename = users.csv
case_sensitive_match = false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And my Splunk search looks like the following.  What is the correct syntax from my lookup?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz sourcetype=xyz:abc fields userid
| lookup userid_lookup | rex field=user "(?:.*\\\|)(?&amp;lt;userid&amp;gt;[\w]*)" OUTPUT title | where title="MD"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 18:03:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-filter-results-using-extracted-fields/m-p/216935#M63708</guid>
      <dc:creator>splunkrocks2014</dc:creator>
      <dc:date>2016-06-22T18:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to filter results using extracted fields from a lookup and a where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-filter-results-using-extracted-fields/m-p/216936#M63709</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Updated&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz sourcetype=xyz:abc | join type=left userId [| inputlookup  userid_lookup  | rex field=user "(?:.*\\\|)(?&amp;lt;userid&amp;gt;[\w]*)" | table userId title ]
 | where title="MD" OR isnull(title)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jun 2016 18:13:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-filter-results-using-extracted-fields/m-p/216936#M63709</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-22T18:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to filter results using extracted fields from a lookup and a where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-filter-results-using-extracted-fields/m-p/216937#M63710</link>
      <description>&lt;P&gt;index=xyz sourcetype=xyz:abc | rex field=user "(?:.&lt;EM&gt;\|)(?[\w]&lt;/EM&gt;)" | lookup user AS user OUTPUT title | search title=MD&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 18:25:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-filter-results-using-extracted-fields/m-p/216937#M63710</guid>
      <dc:creator>ltrand</dc:creator>
      <dc:date>2016-06-22T18:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to filter results using extracted fields from a lookup and a where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-filter-results-using-extracted-fields/m-p/216938#M63711</link>
      <description>&lt;P&gt;It works with title=something, but it doesn't work if searched user with empty title.  For instance,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=xyz sourcetype=xyz:abc | join userid [| inputlookup  userid_lookup  | rex field=user "(?:.*\\\|)(?&amp;lt;userid&amp;gt;[\w]*)" | table userid title ]
  | where isnull(title)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any clues?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 19:04:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-filter-results-using-extracted-fields/m-p/216938#M63711</guid>
      <dc:creator>splunkrocks2014</dc:creator>
      <dc:date>2016-06-22T19:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to filter results using extracted fields from a lookup and a where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-filter-results-using-extracted-fields/m-p/216939#M63712</link>
      <description>&lt;P&gt;What you want to do if the title is empty for a user?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 19:25:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-filter-results-using-extracted-fields/m-p/216939#M63712</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-22T19:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to filter results using extracted fields from a lookup and a where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-filter-results-using-extracted-fields/m-p/216940#M63713</link>
      <description>&lt;P&gt;Basically, the title is never a null value.  I am looking for if there are any users from the events are not matched to the lookup table.  I can do following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz sourcetype=xyz:abc | search NOT [| inputlookup  userid_lookup  | rex field=user "(?:.*\\\|)(?&amp;lt;userid&amp;gt;[\w]*)" | fields userid ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but it doesn't work with the where-clause.  I don't know why.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 20:39:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-filter-results-using-extracted-fields/m-p/216940#M63713</guid>
      <dc:creator>splunkrocks2014</dc:creator>
      <dc:date>2016-06-22T20:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to filter results using extracted fields from a lookup and a where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-filter-results-using-extracted-fields/m-p/216941#M63714</link>
      <description>&lt;P&gt;Try the updated answer (you probably don't need both the condition I wrote in where clause, just use whichever is applicable)&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 20:57:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-filter-results-using-extracted-fields/m-p/216941#M63714</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-22T20:57:33Z</dc:date>
    </item>
  </channel>
</rss>

