<?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 use Where condition in lookup .csv file in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Where-condition-in-lookup-csv-file/m-p/241352#M71774</link>
    <description>&lt;P&gt;I am trying to run with the below query but no result found&lt;/P&gt;

&lt;P&gt;index="indexname"  [ | inputlookup file1.csv where (Allow='Y')| fields Application, Allow | rename Application as App ] | table host, App&lt;/P&gt;

&lt;P&gt;Also tried like this : &lt;BR /&gt;
index="indexname"  [ | inputlookup file1.csv | fields Application, Allow | rename Application as App | search Allow='Y' ] | table host, App&lt;BR /&gt;
No result found. &lt;/P&gt;

&lt;P&gt;Note: the reason I use &lt;STRONG&gt;rename Application as App&lt;/STRONG&gt; as there is no fieldname by Application in raw event. The field Application is only in my lookup file as a column header. &lt;/P&gt;

&lt;P&gt;Anything I am missing out in the query, please help &lt;/P&gt;

&lt;P&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;
Binay Agarwal &lt;/P&gt;</description>
    <pubDate>Wed, 18 Jan 2017 11:15:41 GMT</pubDate>
    <dc:creator>bagarwal</dc:creator>
    <dc:date>2017-01-18T11:15:41Z</dc:date>
    <item>
      <title>How to use Where condition in lookup .csv file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Where-condition-in-lookup-csv-file/m-p/241350#M71772</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I have created a lookup file name file1.csv .  There are two columns in the file "Application" and "Allow" and looks like below . &lt;BR /&gt;
Application, Allow&lt;BR /&gt;
Paint, Y&lt;BR /&gt;
abc*, Y&lt;BR /&gt;
xyz*,&lt;BR /&gt;
aaa*, Y&lt;BR /&gt;
zzz, &lt;/P&gt;

&lt;P&gt;Now, I want to run a query to get the output of application name where Allow = Y.  &lt;/P&gt;

&lt;P&gt;Current Query: &lt;BR /&gt;
index="index_name" [ | inputlookup | table Application | rename Application as App ] | table host, App&lt;/P&gt;

&lt;P&gt;I am very new in working with lookup and would be really helpful if anyone can suggest changes need to be made in the query to match the where condition and get the result or any other way to get the desired result. &lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;BR /&gt;
Binay Agarwal&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:28:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Where-condition-in-lookup-csv-file/m-p/241350#M71772</guid>
      <dc:creator>bagarwal</dc:creator>
      <dc:date>2020-09-29T12:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Where condition in lookup .csv file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Where-condition-in-lookup-csv-file/m-p/241351#M71773</link>
      <description>&lt;P&gt;You can use &lt;CODE&gt;where&lt;/CODE&gt; clause in inputlookup like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup geo_attr_countries.csv where (country="Austria")|table continent subregion
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Inputlookup#Optional_arguments"&gt;https://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Inputlookup#Optional_arguments&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you want to use it together with another search query , try just &lt;CODE&gt;lookup&lt;/CODE&gt; after defining the lookup definitions. For eg: if you have a field &lt;CODE&gt;Application&lt;/CODE&gt; in your search query, you can try &lt;CODE&gt;index=indexname|fields Application|lookup mylookupname|search Allow="Y"&lt;/CODE&gt;&lt;BR /&gt;
where mylookupname is the lookup definition you created out of your file&lt;/P&gt;

&lt;P&gt;Reference : &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Lookup"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Lookup&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 09:20:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Where-condition-in-lookup-csv-file/m-p/241351#M71773</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2017-01-18T09:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Where condition in lookup .csv file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Where-condition-in-lookup-csv-file/m-p/241352#M71774</link>
      <description>&lt;P&gt;I am trying to run with the below query but no result found&lt;/P&gt;

&lt;P&gt;index="indexname"  [ | inputlookup file1.csv where (Allow='Y')| fields Application, Allow | rename Application as App ] | table host, App&lt;/P&gt;

&lt;P&gt;Also tried like this : &lt;BR /&gt;
index="indexname"  [ | inputlookup file1.csv | fields Application, Allow | rename Application as App | search Allow='Y' ] | table host, App&lt;BR /&gt;
No result found. &lt;/P&gt;

&lt;P&gt;Note: the reason I use &lt;STRONG&gt;rename Application as App&lt;/STRONG&gt; as there is no fieldname by Application in raw event. The field Application is only in my lookup file as a column header. &lt;/P&gt;

&lt;P&gt;Anything I am missing out in the query, please help &lt;/P&gt;

&lt;P&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;
Binay Agarwal &lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 11:15:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Where-condition-in-lookup-csv-file/m-p/241352#M71774</guid>
      <dc:creator>bagarwal</dc:creator>
      <dc:date>2017-01-18T11:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Where condition in lookup .csv file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Where-condition-in-lookup-csv-file/m-p/241353#M71775</link>
      <description>&lt;P&gt;Hi Binay,&lt;/P&gt;

&lt;P&gt;Here is what I have done , &lt;BR /&gt;
- Created an input lookup file similar to yours (Application, Allow)&lt;BR /&gt;
- Uploaded the lookup file&lt;BR /&gt;
- Added a lookup definition myapplookup as file based&lt;BR /&gt;
- Created a dummy search to simulate your search and lookup in the lookup file to get the rest of the fields&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|stats count |eval App="Paint,abc*,xyz*,zzz"|eval Host="Host1,Host2,Host3,Host4"|makemv delim="," App|makemv delim="," Host|mvexpand App|mvexpand Host
|table Host App|rename App as Application|lookup myapplookup Application|search Allow="Y"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ignore the first line of the search , it's just a dummy to simulate.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2017 02:20:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Where-condition-in-lookup-csv-file/m-p/241353#M71775</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2017-01-19T02:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Where condition in lookup .csv file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Where-condition-in-lookup-csv-file/m-p/241354#M71776</link>
      <description>&lt;P&gt;hi,if csv file contain src_ip and src_prt,i need all data except src_ip mentioned in the csv file..what will be the  lookup query   ?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:36:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Where-condition-in-lookup-csv-file/m-p/241354#M71776</guid>
      <dc:creator>pinkyy</dc:creator>
      <dc:date>2020-09-30T01:36:42Z</dc:date>
    </item>
  </channel>
</rss>

