<?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 Lookup Table Question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Table-Question/m-p/490687#M137008</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;
This probably a stu*** question, but I am not able to find a clear answer.&lt;/P&gt;

&lt;P&gt;My code to generate the lookup table works. &lt;BR /&gt;
Here are the contents of my lookup table.&lt;BR /&gt;
Input field &lt;STRONG&gt;acct&lt;/STRONG&gt;  Ex: &lt;EM&gt;user1&lt;/EM&gt;&lt;BR /&gt;
Output fields   &lt;STRONG&gt;aid&lt;/STRONG&gt; and &lt;STRONG&gt;adr&lt;/STRONG&gt;  Exs:  &lt;EM&gt;1111&lt;/EM&gt;  and &lt;EM&gt;10.10.10.10&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;Input field is selected from a drop down in dashboard panel.&lt;/P&gt;

&lt;P&gt;Need to search for events containing any combination of &lt;STRONG&gt;acct&lt;/STRONG&gt;, &lt;STRONG&gt;aid&lt;/STRONG&gt; and/or    &lt;STRONG&gt;adr&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;My code results in the same events containing all 3 of these fields.&lt;BR /&gt;
Here is my code.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="linuxevents" AND host=ru.us AND source="/var/log/audit/audit.log" AND earliest="09/23/2019:14:28:00" AND latest="09/23/2019:14:30:00"
`comment("    AND (acct="user1" OR auid=aid OR addr=adr) ")`
| lookup myAAAlookup.csv acct
| where (acct="user1") OR (auid=aid) OR (addr=adr)
| table _time, event_id, host, acct, auid, aid, addr, adr, _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note: If I comment out the where command and uncomment the matching terms AND, the same events are generated containing ALL 3 fields.&lt;/P&gt;

&lt;P&gt;Isn't there a simple way to do this?&lt;/P&gt;

&lt;P&gt;Thanks in advance and God bless,&lt;BR /&gt;
Genesius &lt;/P&gt;</description>
    <pubDate>Fri, 27 Sep 2019 12:55:30 GMT</pubDate>
    <dc:creator>genesiusj</dc:creator>
    <dc:date>2019-09-27T12:55:30Z</dc:date>
    <item>
      <title>Lookup Table Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Table-Question/m-p/490687#M137008</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
This probably a stu*** question, but I am not able to find a clear answer.&lt;/P&gt;

&lt;P&gt;My code to generate the lookup table works. &lt;BR /&gt;
Here are the contents of my lookup table.&lt;BR /&gt;
Input field &lt;STRONG&gt;acct&lt;/STRONG&gt;  Ex: &lt;EM&gt;user1&lt;/EM&gt;&lt;BR /&gt;
Output fields   &lt;STRONG&gt;aid&lt;/STRONG&gt; and &lt;STRONG&gt;adr&lt;/STRONG&gt;  Exs:  &lt;EM&gt;1111&lt;/EM&gt;  and &lt;EM&gt;10.10.10.10&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;Input field is selected from a drop down in dashboard panel.&lt;/P&gt;

&lt;P&gt;Need to search for events containing any combination of &lt;STRONG&gt;acct&lt;/STRONG&gt;, &lt;STRONG&gt;aid&lt;/STRONG&gt; and/or    &lt;STRONG&gt;adr&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;My code results in the same events containing all 3 of these fields.&lt;BR /&gt;
Here is my code.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="linuxevents" AND host=ru.us AND source="/var/log/audit/audit.log" AND earliest="09/23/2019:14:28:00" AND latest="09/23/2019:14:30:00"
`comment("    AND (acct="user1" OR auid=aid OR addr=adr) ")`
| lookup myAAAlookup.csv acct
| where (acct="user1") OR (auid=aid) OR (addr=adr)
| table _time, event_id, host, acct, auid, aid, addr, adr, _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note: If I comment out the where command and uncomment the matching terms AND, the same events are generated containing ALL 3 fields.&lt;/P&gt;

&lt;P&gt;Isn't there a simple way to do this?&lt;/P&gt;

&lt;P&gt;Thanks in advance and God bless,&lt;BR /&gt;
Genesius &lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 12:55:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Table-Question/m-p/490687#M137008</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2019-09-27T12:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup Table Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Table-Question/m-p/490688#M137009</link>
      <description>&lt;P&gt;Hi genesiusj,&lt;BR /&gt;
let me understand:&lt;BR /&gt;
you have a table where there are three fields the first is the key and the other two are the ones to use in search, then you wanto to search for the key and one o the other fields, is it correct?&lt;/P&gt;

&lt;P&gt;If this is your need, try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="linuxevents" AND host=ru.us AND source="/var/log/audit/audit.log" AND earliest="09/23/2019:14:28:00" AND latest="09/23/2019:14:30:00"
`comment("    AND (acct="user1" OR auid=aid OR addr=adr) ")`
| lookup myAAAlookup.csv acct OUTPUT aid adr
| search (acct="user1") AND (auid=aid) OR (addr=adr)
| table _time event_id host acct auid aid addr adr _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 13:21:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Table-Question/m-p/490688#M137009</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-09-27T13:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup Table Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Table-Question/m-p/490689#M137010</link>
      <description>&lt;P&gt;Use this:&lt;/P&gt;

&lt;P&gt;| where (acct="user1") AND ( (auid=aid) OR (addr=adr) )&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 15:00:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Table-Question/m-p/490689#M137010</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2019-09-27T15:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup Table Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Table-Question/m-p/490690#M137011</link>
      <description>&lt;P&gt;@gcusello &lt;BR /&gt;
Thanks. "Nor results found."&lt;/P&gt;

&lt;P&gt;I need to use OR  OR for the 3 fields, not AND  OR.&lt;BR /&gt;
Tried this&lt;BR /&gt;
    | search (acct="onsjaro") OR (auid=aid) OR (addr=adr)&lt;BR /&gt;
The same 18 events.&lt;/P&gt;

&lt;P&gt;Thanks and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Sat, 28 Sep 2019 01:55:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Table-Question/m-p/490690#M137011</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2019-09-28T01:55:37Z</dc:date>
    </item>
  </channel>
</rss>

