<?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: Lookup Madness in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Madness-How-to-match-results-to-ONLY-the-names-in-a-list/m-p/626279#M217677</link>
    <description>&lt;P&gt;It sounds like you want a subsearch that incorporates the lookup file into the base search.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=epp "Device Control" AND ("USB Storage Device" OR "Internal CD or DVD RW" OR "Internal Floppy Drive" OR "Zip Drive") AND NOT ("file read" OR "Connected" OR "unblocked" OR "Disconnected") 
```Read in the lookup file.```
```Be sure to change "foo" to the name of field in the lookup file.```
```Change '1000' to a number larger than the number of entries in the lookup.```
[ | inputlookup R_Emp.csv | return 1000 $foo ]
| rex field=_raw "epp\.tusimple\.ai\s\-\s(?&amp;lt;LogSource&amp;gt;.*)\s\-\s"
| rex field=_raw "\[Event\sName\]\s(?&amp;lt;EventAction&amp;gt;.*)\s\|\s\[Client\sComputer"
| rex field=_raw "\[Client\sComputer\]\s(?&amp;lt;Hostname&amp;gt;.*)\s\|\s\[IP\sAddress"
| rex field=_raw "\[IP\sAddress\]\s(?&amp;lt;IPAddress&amp;gt;.*)\s\|\s\[MAC\sAddress"
| rex field=_raw "\[MAC\sAddress\]\s(?&amp;lt;MACAddress&amp;gt;.*)\s\|\s\[Serial\sNumber"
| rex field=_raw "\[Serial\sNumber\](?&amp;lt;SerialNumber&amp;gt;.*)\|\s\[Client\sUser"
| rex field=_raw "\[Client\sUser\](?&amp;lt;UserName&amp;gt;.*)\|\s\[Device\sType"
| rex field=_raw "\[Device\sType\](?&amp;lt;DeviceType&amp;gt;.*)\|\s\[Device\]"
| rex field=_raw "\|\s\[Device\](?&amp;lt;DeviceDescription&amp;gt;.*)\|\s\[Device\sVID\]"
| rex field=_raw "\|\s\[Device\sSerial\](?&amp;lt;DeviceSerial&amp;gt;.*)\|\s\[EPP\sClient\sVersion\]"
| rex field=_raw "\[File\s\Name\](?&amp;lt;FileName&amp;gt;.*)\|\s\[File\sHash\]"
| rex field=_raw "\|\s\[File\sType\](?&amp;lt;FileType&amp;gt;.*)\|\s\[File\sSize\]"
| rex field=_raw "\|\s\[File\sSize\](?&amp;lt;FileSize&amp;gt;.*)\|\s\[Justification\]"
| rex field=_raw "\[Date\/Time\(Client\)\](?&amp;lt;EventTimeStamp&amp;gt;.*)\|\s\[Date\/Time\(Server\sUTC\)\]"

| table EventTimeStamp LogSource EventAction UserName FileName FileType FileSize Hostname IPAddress MACAddress SerialNumber DeviceType DeviceDescription DeviceSerial ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 07 Jan 2023 17:51:51 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2023-01-07T17:51:51Z</dc:date>
    <item>
      <title>Lookup Madness: How to match results to ONLY the names in a list I have using a lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Madness-How-to-match-results-to-ONLY-the-names-in-a-list/m-p/626261#M217672</link>
      <description>&lt;P&gt;I am trying to match results to ONLY the names in a list I have using a lookup.&amp;nbsp; I cant figure out for the life of me what I am doing wrong, been trying every single variated on lookup and inputlookup&amp;nbsp; I can think of or find online.&amp;nbsp; Anyone have any idea what I am doing wrong?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;index=epp "Device Control" AND ("USB Storage Device" OR "Internal CD or DVD RW" OR "Internal Floppy Drive" OR "Zip Drive") AND NOT ("file read" OR "Connected" OR "unblocked" OR "Disconnected")&lt;BR /&gt;| rex field=_raw "epp\.tusimple\.ai\s\-\s(?&amp;lt;LogSource&amp;gt;.*)\s\-\s"&lt;BR /&gt;| rex field=_raw "\[Event\sName\]\s(?&amp;lt;EventAction&amp;gt;.*)\s\|\s\[Client\sComputer"&lt;BR /&gt;| rex field=_raw "\[Client\sComputer\]\s(?&amp;lt;Hostname&amp;gt;.*)\s\|\s\[IP\sAddress"&lt;BR /&gt;| rex field=_raw "\[IP\sAddress\]\s(?&amp;lt;IPAddress&amp;gt;.*)\s\|\s\[MAC\sAddress"&lt;BR /&gt;| rex field=_raw "\[MAC\sAddress\]\s(?&amp;lt;MACAddress&amp;gt;.*)\s\|\s\[Serial\sNumber"&lt;BR /&gt;| rex field=_raw "\[Serial\sNumber\](?&amp;lt;SerialNumber&amp;gt;.*)\|\s\[Client\sUser"&lt;BR /&gt;| rex field=_raw "\[Client\sUser\](?&amp;lt;UserName&amp;gt;.*)\|\s\[Device\sType"&lt;BR /&gt;| rex field=_raw "\[Device\sType\](?&amp;lt;DeviceType&amp;gt;.*)\|\s\[Device\]"&lt;BR /&gt;| rex field=_raw "\|\s\[Device\](?&amp;lt;DeviceDescription&amp;gt;.*)\|\s\[Device\sVID\]"&lt;BR /&gt;| rex field=_raw "\|\s\[Device\sSerial\](?&amp;lt;DeviceSerial&amp;gt;.*)\|\s\[EPP\sClient\sVersion\]"&lt;BR /&gt;| rex field=_raw "\[File\s\Name\](?&amp;lt;FileName&amp;gt;.*)\|\s\[File\sHash\]"&lt;BR /&gt;| rex field=_raw "\|\s\[File\sType\](?&amp;lt;FileType&amp;gt;.*)\|\s\[File\sSize\]"&lt;BR /&gt;| rex field=_raw "\|\s\[File\sSize\](?&amp;lt;FileSize&amp;gt;.*)\|\s\[Justification\]"&lt;BR /&gt;| rex field=_raw "\[Date\/Time\(Client\)\](?&amp;lt;EventTimeStamp&amp;gt;.*)\|\s\[Date\/Time\(Server\sUTC\)\]"&lt;/P&gt;
&lt;P&gt;[ | inputlookup R_Emp.csv | table EventTimeStamp LogSource EventAction UserName FileName FileType FileSize Hostname IPAddress MACAddress SerialNumber DeviceType DeviceDescription DeviceSerial ]&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 22:34:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Madness-How-to-match-results-to-ONLY-the-names-in-a-list/m-p/626261#M217672</guid>
      <dc:creator>DesertSocBum</dc:creator>
      <dc:date>2023-01-06T22:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup Madness</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Madness-How-to-match-results-to-ONLY-the-names-in-a-list/m-p/626267#M217673</link>
      <description>&lt;P&gt;Understand that subsearches (commands within square brackets) run before the main search and the results of the subsearch become part of the query string.&amp;nbsp; In this case, the &lt;FONT face="courier new,courier"&gt;inputlookup&lt;/FONT&gt; command reads the R_Emp.csv file and then the &lt;FONT face="courier new,courier"&gt;table &lt;/FONT&gt;command selects several fields (presumably existing in the lookup file).&amp;nbsp; That list of fields and their values then are added to the end of the last command before the subsearch - resulting in either unexpected results or an error.&lt;/P&gt;&lt;P&gt;Let's back up a little.&amp;nbsp; Before we can suggest a solution, we need to know a few things.&amp;nbsp; What fields are in the lookup file?&amp;nbsp; What should the final results look like?&amp;nbsp; What do you mean by "match results to ONLY the names in a list"?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 21:48:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Madness-How-to-match-results-to-ONLY-the-names-in-a-list/m-p/626267#M217673</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-01-06T21:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup Madness: How to match results to ONLY the names in a list I have using a lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Madness-How-to-match-results-to-ONLY-the-names-in-a-list/m-p/626271#M217674</link>
      <description>&lt;P&gt;Have you tried it like this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=epp "Device Control" AND ("USB Storage Device" OR "Internal CD or DVD RW" OR "Internal Floppy Drive" OR "Zip Drive") AND NOT ("file read" OR "Connected" OR "unblocked" OR "Disconnected")
| rex field=_raw "epp\.tusimple\.ai\s\-\s(?&amp;lt;LogSource&amp;gt;.*)\s\-\s"
| rex field=_raw "\[Event\sName\]\s(?&amp;lt;EventAction&amp;gt;.*)\s\|\s\[Client\sComputer"
| rex field=_raw "\[Client\sComputer\]\s(?&amp;lt;Hostname&amp;gt;.*)\s\|\s\[IP\sAddress"
| rex field=_raw "\[IP\sAddress\]\s(?&amp;lt;IPAddress&amp;gt;.*)\s\|\s\[MAC\sAddress"
| rex field=_raw "\[MAC\sAddress\]\s(?&amp;lt;MACAddress&amp;gt;.*)\s\|\s\[Serial\sNumber"
| rex field=_raw "\[Serial\sNumber\](?&amp;lt;SerialNumber&amp;gt;.*)\|\s\[Client\sUser"
| rex field=_raw "\[Client\sUser\](?&amp;lt;UserName&amp;gt;.*)\|\s\[Device\sType"
| rex field=_raw "\[Device\sType\](?&amp;lt;DeviceType&amp;gt;.*)\|\s\[Device\]"
| rex field=_raw "\|\s\[Device\](?&amp;lt;DeviceDescription&amp;gt;.*)\|\s\[Device\sVID\]"
| rex field=_raw "\|\s\[Device\sSerial\](?&amp;lt;DeviceSerial&amp;gt;.*)\|\s\[EPP\sClient\sVersion\]"
| rex field=_raw "\[File\s\Name\](?&amp;lt;FileName&amp;gt;.*)\|\s\[File\sHash\]"
| rex field=_raw "\|\s\[File\sType\](?&amp;lt;FileType&amp;gt;.*)\|\s\[File\sSize\]"
| rex field=_raw "\|\s\[File\sSize\](?&amp;lt;FileSize&amp;gt;.*)\|\s\[Justification\]"
| rex field=_raw "\[Date\/Time\(Client\)\](?&amp;lt;EventTimeStamp&amp;gt;.*)\|\s\[Date\/Time\(Server\sUTC\)\]"
| search
[ | inputlookup R_Emp.csv | table EventTimeStamp LogSource EventAction UserName FileName FileType FileSize Hostname IPAddress MACAddress SerialNumber DeviceType DeviceDescription DeviceSerial | format ]&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 06 Jan 2023 22:36:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Madness-How-to-match-results-to-ONLY-the-names-in-a-list/m-p/626271#M217674</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-01-06T22:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup Madness</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Madness-How-to-match-results-to-ONLY-the-names-in-a-list/m-p/626274#M217675</link>
      <description>&lt;P&gt;I might be going about this the wrong way then.&amp;nbsp; The original goal was to take the results of the main search with all the regex and only show events that match Employee names in the .csv.&amp;nbsp; The only thing in the list is rows of names.&amp;nbsp; Instead of typing out&amp;nbsp; something like AND ("Joe Dirt" OR "JANE DOE" OR etc. . .&amp;nbsp; before the regex.&amp;nbsp; So I only want hits on the names in the list and to ignore results for any other name in the index if that makes sense&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 23:51:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Madness-How-to-match-results-to-ONLY-the-names-in-a-list/m-p/626274#M217675</guid>
      <dc:creator>DesertSocBum</dc:creator>
      <dc:date>2023-01-06T23:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup Madness: How to match results to ONLY the names in a list I have using a lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Madness-How-to-match-results-to-ONLY-the-names-in-a-list/m-p/626278#M217676</link>
      <description>&lt;P&gt;That won't do because the CSV only has one field in it.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2023 00:52:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Madness-How-to-match-results-to-ONLY-the-names-in-a-list/m-p/626278#M217676</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-01-07T00:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup Madness</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Madness-How-to-match-results-to-ONLY-the-names-in-a-list/m-p/626279#M217677</link>
      <description>&lt;P&gt;It sounds like you want a subsearch that incorporates the lookup file into the base search.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=epp "Device Control" AND ("USB Storage Device" OR "Internal CD or DVD RW" OR "Internal Floppy Drive" OR "Zip Drive") AND NOT ("file read" OR "Connected" OR "unblocked" OR "Disconnected") 
```Read in the lookup file.```
```Be sure to change "foo" to the name of field in the lookup file.```
```Change '1000' to a number larger than the number of entries in the lookup.```
[ | inputlookup R_Emp.csv | return 1000 $foo ]
| rex field=_raw "epp\.tusimple\.ai\s\-\s(?&amp;lt;LogSource&amp;gt;.*)\s\-\s"
| rex field=_raw "\[Event\sName\]\s(?&amp;lt;EventAction&amp;gt;.*)\s\|\s\[Client\sComputer"
| rex field=_raw "\[Client\sComputer\]\s(?&amp;lt;Hostname&amp;gt;.*)\s\|\s\[IP\sAddress"
| rex field=_raw "\[IP\sAddress\]\s(?&amp;lt;IPAddress&amp;gt;.*)\s\|\s\[MAC\sAddress"
| rex field=_raw "\[MAC\sAddress\]\s(?&amp;lt;MACAddress&amp;gt;.*)\s\|\s\[Serial\sNumber"
| rex field=_raw "\[Serial\sNumber\](?&amp;lt;SerialNumber&amp;gt;.*)\|\s\[Client\sUser"
| rex field=_raw "\[Client\sUser\](?&amp;lt;UserName&amp;gt;.*)\|\s\[Device\sType"
| rex field=_raw "\[Device\sType\](?&amp;lt;DeviceType&amp;gt;.*)\|\s\[Device\]"
| rex field=_raw "\|\s\[Device\](?&amp;lt;DeviceDescription&amp;gt;.*)\|\s\[Device\sVID\]"
| rex field=_raw "\|\s\[Device\sSerial\](?&amp;lt;DeviceSerial&amp;gt;.*)\|\s\[EPP\sClient\sVersion\]"
| rex field=_raw "\[File\s\Name\](?&amp;lt;FileName&amp;gt;.*)\|\s\[File\sHash\]"
| rex field=_raw "\|\s\[File\sType\](?&amp;lt;FileType&amp;gt;.*)\|\s\[File\sSize\]"
| rex field=_raw "\|\s\[File\sSize\](?&amp;lt;FileSize&amp;gt;.*)\|\s\[Justification\]"
| rex field=_raw "\[Date\/Time\(Client\)\](?&amp;lt;EventTimeStamp&amp;gt;.*)\|\s\[Date\/Time\(Server\sUTC\)\]"

| table EventTimeStamp LogSource EventAction UserName FileName FileType FileSize Hostname IPAddress MACAddress SerialNumber DeviceType DeviceDescription DeviceSerial ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2023 17:51:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Madness-How-to-match-results-to-ONLY-the-names-in-a-list/m-p/626279#M217677</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-01-07T17:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup Madness</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Madness-How-to-match-results-to-ONLY-the-names-in-a-list/m-p/626284#M217678</link>
      <description>&lt;P&gt;That did it, and I had return username in there at one point thru my 100 different variations, just didnt set the number.&amp;nbsp; Thank you! Now I know!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2023 01:15:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Madness-How-to-match-results-to-ONLY-the-names-in-a-list/m-p/626284#M217678</guid>
      <dc:creator>DesertSocBum</dc:creator>
      <dc:date>2023-01-07T01:15:04Z</dc:date>
    </item>
  </channel>
</rss>

