<?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 match two values from a lookup table and a search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-values-from-a-lookup-table-and-a-search/m-p/276327#M83343</link>
    <description>&lt;P&gt;Does this work better?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=web sourcetype=login
 earliest=-31d@d latest=@d
 | bucket span=1m _time
 | join max=0 type=left usetime=false username
 [
 | inputlookup 2015LoginReport.csv
 ]
 | stats count by _time username
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 31 May 2016 17:52:12 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2016-05-31T17:52:12Z</dc:date>
    <item>
      <title>How to match two values from a lookup table and a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-values-from-a-lookup-table-and-a-search/m-p/276321#M83337</link>
      <description>&lt;P&gt;I have a lookup table with a list of usernames that have logged in to a website last year in 2015, and I'm trying to match logins from another search with any usernames that exist in that lookup table for the past 30 days. &lt;/P&gt;

&lt;P&gt;I tried the below search, but it doesn't quite work as expected... well, it produces an output but only for the current "today"... and I know the matched list should be much greater.&lt;/P&gt;

&lt;P&gt;The 2015LoginReport.csv lookup contains only a single column of username which matches the format of the index=web sourcetype=login search, and i'm able to run a | inputlookup 2015LoginReport.csv which shows the list... so there are no issues with the CSV.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=web sourcetype=login
earliest=-31d@d latest=@d
| bucket span=1m _time
| join username
[
| inputlookup 2015LoginReport.csv
]
| stats count by _time username
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2016 14:56:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-values-from-a-lookup-table-and-a-search/m-p/276321#M83337</guid>
      <dc:creator>WyldeRhoads</dc:creator>
      <dc:date>2016-05-31T14:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to match two values from a lookup table and a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-values-from-a-lookup-table-and-a-search/m-p/276322#M83338</link>
      <description>&lt;P&gt;The join uses subsearch and the subsearch has a limit of 10K rows which may be skewing the result. How many matches you're getting right now? also, give this a try.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=web sourcetype=login  earliest=-31d@d latest=@d  [ | inputlookup 2015LoginReport.csv | table username ]
| bucket span=1m _time  | stats count by _time username
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 May 2016 15:38:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-values-from-a-lookup-table-and-a-search/m-p/276322#M83338</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-05-31T15:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to match two values from a lookup table and a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-values-from-a-lookup-table-and-a-search/m-p/276323#M83339</link>
      <description>&lt;P&gt;Doesnt seem to work, I'm getting a "no results found". &lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2016 16:13:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-values-from-a-lookup-table-and-a-search/m-p/276323#M83339</guid>
      <dc:creator>WyldeRhoads</dc:creator>
      <dc:date>2016-05-31T16:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to match two values from a lookup table and a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-values-from-a-lookup-table-and-a-search/m-p/276324#M83340</link>
      <description>&lt;P&gt;not sure why somesoni2's search doesnt work.  it looks good based on the example search you provided.&lt;/P&gt;

&lt;P&gt;Is your time picker set to all time?&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2016 16:31:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-values-from-a-lookup-table-and-a-search/m-p/276324#M83340</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-05-31T16:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to match two values from a lookup table and a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-values-from-a-lookup-table-and-a-search/m-p/276325#M83341</link>
      <description>&lt;P&gt;Does the field name in the lookup table and the actual data match (case-sensitive)? &lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2016 16:33:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-values-from-a-lookup-table-and-a-search/m-p/276325#M83341</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-05-31T16:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to match two values from a lookup table and a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-values-from-a-lookup-table-and-a-search/m-p/276326#M83342</link>
      <description>&lt;P&gt;yes they match, they are just ID numbers. I'm getting some matches with my OP search, but its only producing 100 or so matches for today, even though i can eyeball far more matches.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2016 17:40:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-values-from-a-lookup-table-and-a-search/m-p/276326#M83342</guid>
      <dc:creator>WyldeRhoads</dc:creator>
      <dc:date>2016-05-31T17:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to match two values from a lookup table and a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-values-from-a-lookup-table-and-a-search/m-p/276327#M83343</link>
      <description>&lt;P&gt;Does this work better?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=web sourcetype=login
 earliest=-31d@d latest=@d
 | bucket span=1m _time
 | join max=0 type=left usetime=false username
 [
 | inputlookup 2015LoginReport.csv
 ]
 | stats count by _time username
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 May 2016 17:52:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-values-from-a-lookup-table-and-a-search/m-p/276327#M83343</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-05-31T17:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to match two values from a lookup table and a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-values-from-a-lookup-table-and-a-search/m-p/276328#M83344</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=web sourcetype=login earliest=-31d@d latest=@d | eval type="30Days"
| appendpipe [| inputlookup 2015LoginReport.csv | eval type="2015"]
| stats dc(type) AS numTypes values(*) AS * BY type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now you have a full join with no discrimination.&lt;/P&gt;

&lt;P&gt;For left join, continue with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| search type = "30Days"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For right join, continue with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| search type = "2015"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For outer join, continue with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| numTypes = "1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For inner join, continue with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| numTypes = "2"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Jun 2016 01:06:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-values-from-a-lookup-table-and-a-search/m-p/276328#M83344</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-01T01:06:21Z</dc:date>
    </item>
  </channel>
</rss>

