<?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: Subesearch with Inputlookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Subesearch-with-Inputlookup/m-p/563329#M196269</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;thank you for your solution,&lt;/P&gt;&lt;P&gt;I made some changes in my query, and it dosent work,&lt;/P&gt;&lt;P&gt;I would be happy if you can tell me what is the problem&lt;/P&gt;&lt;P&gt;Here is my new query:&lt;/P&gt;&lt;P&gt;index="example"&lt;/P&gt;&lt;P&gt;|eval type1=mvindex(type.split(":"),0)&lt;/P&gt;&lt;P&gt;|eval type2=mvindex(type.split(":"),1)&lt;/P&gt;&lt;P&gt;|search&lt;/P&gt;&lt;P&gt;[|inputlookup myfile.csv&amp;nbsp;&lt;/P&gt;&lt;P&gt;| eval range=mvrange(1,3)&lt;/P&gt;&lt;P&gt;| mvexpand range&lt;/P&gt;&lt;P&gt;| eval type2=if(range==2,type,null)&lt;/P&gt;&lt;P&gt;| eval type1=if(range==1,type,null)&lt;/P&gt;&lt;P&gt;| table type1 type2]&lt;/P&gt;&lt;P&gt;|table type1 type2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 15 Aug 2021 15:30:55 GMT</pubDate>
    <dc:creator>Shimon81</dc:creator>
    <dc:date>2021-08-15T15:30:55Z</dc:date>
    <item>
      <title>Subesearch with Inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subesearch-with-Inputlookup/m-p/562748#M196085</link>
      <description>&lt;P class="lia-align-left"&gt;&amp;nbsp;I want to run a base query where some fields has a value which is present in inputlookup table&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;For example,&amp;nbsp; I have a csv file with the content:&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;type&lt;/P&gt;&lt;P class="lia-align-left"&gt;1&lt;/P&gt;&lt;P class="lia-align-left"&gt;2&lt;/P&gt;&lt;P class="lia-align-left"&gt;3&lt;/P&gt;&lt;P class="lia-align-left"&gt;.&lt;/P&gt;&lt;P class="lia-align-left"&gt;.&lt;/P&gt;&lt;P class="lia-align-left"&gt;and in my basesearch i have the fields : type1, type2&lt;/P&gt;&lt;P class="lia-align-left"&gt;I tried this query but is not working:&lt;/P&gt;&lt;P class="lia-align-left"&gt;index="example"&lt;/P&gt;&lt;P class="lia-align-left"&gt;&lt;SPAN&gt;[|inputlookup myfile .csv&amp;nbsp;|stats values(type) as types]&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-align-left"&gt;|Where type1 in(types) OR type2 in(types)&lt;/P&gt;&lt;P class="lia-align-left"&gt;|table type1 type2&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;Thanks&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 14:48:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subesearch-with-Inputlookup/m-p/562748#M196085</guid>
      <dc:creator>Shimon81</dc:creator>
      <dc:date>2021-08-10T14:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: Subesearch with Inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subesearch-with-Inputlookup/m-p/562757#M196088</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237314"&gt;@Shimon81&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Your approach is right. You need to rewrite the query.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="example" type1 IN([|inputlookup myfile.csv | stats values(type) as types | return $types]) OR type2 IN([|inputlookup myfile.csv | stats values(type) as types | return $types])
| table type1 type2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you, a like would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 15:33:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subesearch-with-Inputlookup/m-p/562757#M196088</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-08-10T15:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Subesearch with Inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subesearch-with-Inputlookup/m-p/562768#M196094</link>
      <description>&lt;P&gt;Alternatively (without the double lookup)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="example"
[|inputlookup myfile.csv 
| eval range=mvrange(1,3)
| mvexpand range
| eval type2=if(range==2,type,null)
| eval type1=if(range==1,type,null)
| table type1 type2]
|table type1 type2 &lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 10 Aug 2021 16:12:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subesearch-with-Inputlookup/m-p/562768#M196094</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-08-10T16:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Subesearch with Inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subesearch-with-Inputlookup/m-p/563329#M196269</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;thank you for your solution,&lt;/P&gt;&lt;P&gt;I made some changes in my query, and it dosent work,&lt;/P&gt;&lt;P&gt;I would be happy if you can tell me what is the problem&lt;/P&gt;&lt;P&gt;Here is my new query:&lt;/P&gt;&lt;P&gt;index="example"&lt;/P&gt;&lt;P&gt;|eval type1=mvindex(type.split(":"),0)&lt;/P&gt;&lt;P&gt;|eval type2=mvindex(type.split(":"),1)&lt;/P&gt;&lt;P&gt;|search&lt;/P&gt;&lt;P&gt;[|inputlookup myfile.csv&amp;nbsp;&lt;/P&gt;&lt;P&gt;| eval range=mvrange(1,3)&lt;/P&gt;&lt;P&gt;| mvexpand range&lt;/P&gt;&lt;P&gt;| eval type2=if(range==2,type,null)&lt;/P&gt;&lt;P&gt;| eval type1=if(range==1,type,null)&lt;/P&gt;&lt;P&gt;| table type1 type2]&lt;/P&gt;&lt;P&gt;|table type1 type2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 15:30:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subesearch-with-Inputlookup/m-p/563329#M196269</guid>
      <dc:creator>Shimon81</dc:creator>
      <dc:date>2021-08-15T15:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Subesearch with Inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subesearch-with-Inputlookup/m-p/563330#M196270</link>
      <description>&lt;P&gt;The split function takes 2 arguments, it isn't a method on the type object.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|eval type1=mvindex(split(type,":"),0)
|eval type2=mvindex(split(type,":"),1)&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 15 Aug 2021 15:44:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subesearch-with-Inputlookup/m-p/563330#M196270</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-08-15T15:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Subesearch with Inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subesearch-with-Inputlookup/m-p/563333#M196271</link>
      <description>&lt;P&gt;Yes You right, but is not my problem ,&lt;/P&gt;&lt;P&gt;I got result with type that not in my csv file&lt;/P&gt;&lt;P&gt;Here is my query:&lt;/P&gt;&lt;P&gt;index="example"&lt;/P&gt;&lt;P&gt;|eval type1=mvindex(split(type,":"),0)&lt;/P&gt;&lt;P&gt;|eval type2=mvindex(split(type,":"),1)&lt;/P&gt;&lt;P&gt;|search&lt;/P&gt;&lt;P&gt;[|inputlookup myfile.csv&amp;nbsp;&lt;/P&gt;&lt;P&gt;| eval range=mvrange(1,3)&lt;/P&gt;&lt;P&gt;| mvexpand range&lt;/P&gt;&lt;P&gt;| eval type2=if(range==2,type,null)&lt;/P&gt;&lt;P&gt;| eval type1=if(range==1,type,null)&lt;/P&gt;&lt;P&gt;| table type1 type2]&lt;/P&gt;&lt;P&gt;|table type1 type2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 16:01:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subesearch-with-Inputlookup/m-p/563333#M196271</guid>
      <dc:creator>Shimon81</dc:creator>
      <dc:date>2021-08-15T16:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Subesearch with Inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subesearch-with-Inputlookup/m-p/563335#M196273</link>
      <description>&lt;P&gt;Please explain what the issue is in more detail.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 16:12:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subesearch-with-Inputlookup/m-p/563335#M196273</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-08-15T16:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Subesearch with Inputlookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subesearch-with-Inputlookup/m-p/563337#M196275</link>
      <description>&lt;P&gt;I have in my search base a field named 'type' that I need to split into type1 and type2 and to check if one of them exists in my csv file. My search at the moment is giving me a result that both types do not exist in the csv file, this is my query at the moment:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index="example"&lt;/P&gt;&lt;P&gt;|eval type1=mvindex(split(type,":"),0)&lt;/P&gt;&lt;P&gt;|eval type2=mvindex(split(type,":"),1)&lt;/P&gt;&lt;P&gt;|search&lt;/P&gt;&lt;P&gt;[|inputlookup myfile.csv&amp;nbsp;&lt;/P&gt;&lt;P&gt;| eval range=mvrange(1,3)&lt;/P&gt;&lt;P&gt;| mvexpand range&lt;/P&gt;&lt;P&gt;| eval type2=if(range==2,type,null)&lt;/P&gt;&lt;P&gt;| eval type1=if(range==1,type,null)&lt;/P&gt;&lt;P&gt;| table type1 type2]&lt;/P&gt;&lt;P&gt;|table type1 type2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 17:43:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subesearch-with-Inputlookup/m-p/563337#M196275</guid>
      <dc:creator>Shimon81</dc:creator>
      <dc:date>2021-08-15T17:43:35Z</dc:date>
    </item>
  </channel>
</rss>

