<?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: Search Using Lookup with Multiple Search Terms for the Same Field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-Using-Lookup-with-Multiple-Search-Terms-for-the-Same/m-p/561262#M171090</link>
    <description>&lt;P&gt;This is exactly what I needed, thank you!&amp;nbsp; I was able to append the following to my subsearch to get the desired result:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| format mvsep="AND"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jul 2021 20:56:32 GMT</pubDate>
    <dc:creator>stauff</dc:creator>
    <dc:date>2021-07-28T20:56:32Z</dc:date>
    <item>
      <title>Search Using Lookup with Multiple Search Terms for the Same Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Using-Lookup-with-Multiple-Search-Terms-for-the-Same/m-p/561231#M159516</link>
      <description>&lt;P&gt;Hello All.&lt;/P&gt;&lt;P&gt;I am trying to use a lookup to perform a tstats search against a data model, where I want multiple search terms for the same field.&amp;nbsp; However, I cannot get this to work as desired.&amp;nbsp; I have an example below to show what is happening, and what I'm trying to achieve.&lt;/P&gt;&lt;P&gt;I have a lookup file named search_terms.csv:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;process_exec&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;process&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;process&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;someexe.exe&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;*param1*&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;*param2*&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Given this lookup file, here is the expanded search I am trying to achieve:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats summariesonly=false allow_old_summaries=true count from datamodel=Endpoint.Processes where (Processes.process_exec=someexe.exe AND Processes.process=*param1* AND Processes.process=*param2*) by Processes.dest&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the first search I tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats summariesonly=false allow_old_summaries=true count from datamodel=Endpoint.Processes where [ | inputlookup search_terms.csv | fields process_exec process | rename process_exec AS Processes.process_exec | rename process AS Processes.process ] by Processes.dest&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, expanding this search leads to the second process column being ignored:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats summariesonly=false allow_old_summaries=true count from datamodel=Endpoint.Processes where (Processes.process_exec=someexe.exe AND Processes.process=*param1*) by Processes.dest&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since this did not work, I tried editing the lookup file to look like this:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;process_exec&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;process&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;someexe.exe&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;*param1*|||*param2*&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I used makemv to make the process field multivalue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats summariesonly=false allow_old_summaries=true count from datamodel=Endpoint.Processes where [ | inputlookup search_terms.csv | fields process_exec process | makemv delim="|||" process | rename process_exec AS Processes.process_exec | rename process AS Processes.process ] by Processes.dest&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this search expanded lead to an "OR" being used for the 2 process query values, instead of an "AND":&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats summariesonly=false allow_old_summaries=true count from datamodel=Endpoint.Processes where (Processes.process_exec=someexe.exe AND (Processes.process=*param1* OR Processes.process=*param2*)) by Processes.dest&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know of a method to create a search using a lookup that would lead to my desired search of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats summariesonly=false allow_old_summaries=true count from datamodel=Endpoint.Processes where (Processes.process_exec=someexe.exe AND Processes.process=*param1* AND Processes.process=*param2*) by Processes.dest&lt;/LI-CODE&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 16:53:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Using-Lookup-with-Multiple-Search-Terms-for-the-Same/m-p/561231#M159516</guid>
      <dc:creator>stauff</dc:creator>
      <dc:date>2021-07-28T16:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Search Using Lookup with Multiple Search Terms for the Same Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Using-Lookup-with-Multiple-Search-Terms-for-the-Same/m-p/561257#M167242</link>
      <description>&lt;P&gt;Check out the &lt;FONT face="courier new,courier"&gt;format&lt;/FONT&gt; command.&amp;nbsp; It lets you change how the result of the subsearch is formatted, including replacing OR with AND.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 20:28:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Using-Lookup-with-Multiple-Search-Terms-for-the-Same/m-p/561257#M167242</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-07-28T20:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Search Using Lookup with Multiple Search Terms for the Same Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Using-Lookup-with-Multiple-Search-Terms-for-the-Same/m-p/561262#M171090</link>
      <description>&lt;P&gt;This is exactly what I needed, thank you!&amp;nbsp; I was able to append the following to my subsearch to get the desired result:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| format mvsep="AND"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 20:56:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Using-Lookup-with-Multiple-Search-Terms-for-the-Same/m-p/561262#M171090</guid>
      <dc:creator>stauff</dc:creator>
      <dc:date>2021-07-28T20:56:32Z</dc:date>
    </item>
  </channel>
</rss>

