<?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 Complex lookup table question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Complex-lookup-table-question/m-p/45171#M10681</link>
    <description>&lt;P&gt;I have a lookup table with two values in the lookup table that I want to use in the end report.&lt;/P&gt;

&lt;P&gt;Example: (table with and ip,source) (xxx.xxx.xxx.xxx,incident report)&lt;/P&gt;

&lt;P&gt;I want to look at my events and find the IP in the events and then so the event data with the source from the table in the report.  this way the report viewer will know what the offending IP and how the IP was added to the table.&lt;/P&gt;

&lt;P&gt;Example Results&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;srcIP     dstIP    srcPORT  dstPORT   source&lt;BR /&gt;
x.x.x.x   y.y.y.y   5700    80        incident report&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I have this type of search that is working:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="my_summary" [| inputlookup lookup.csv | rename ip as query | fields query ] | top 20 srcIP dstIP srcPORT dstPORT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this search does not work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="my_summary" [| inputlookup lookup.csv | rename ip as query | fields query source ] | top 20 srcIP dstIP srcPORT dstPORT source
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;how do I do a lookup for the ip and tie the ip the the source from the lookup table?&lt;BR /&gt;
should I be using a join statement rather than a lookup?&lt;/P&gt;</description>
    <pubDate>Fri, 23 Aug 2013 20:45:38 GMT</pubDate>
    <dc:creator>hartfoml</dc:creator>
    <dc:date>2013-08-23T20:45:38Z</dc:date>
    <item>
      <title>Complex lookup table question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Complex-lookup-table-question/m-p/45171#M10681</link>
      <description>&lt;P&gt;I have a lookup table with two values in the lookup table that I want to use in the end report.&lt;/P&gt;

&lt;P&gt;Example: (table with and ip,source) (xxx.xxx.xxx.xxx,incident report)&lt;/P&gt;

&lt;P&gt;I want to look at my events and find the IP in the events and then so the event data with the source from the table in the report.  this way the report viewer will know what the offending IP and how the IP was added to the table.&lt;/P&gt;

&lt;P&gt;Example Results&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;srcIP     dstIP    srcPORT  dstPORT   source&lt;BR /&gt;
x.x.x.x   y.y.y.y   5700    80        incident report&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I have this type of search that is working:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="my_summary" [| inputlookup lookup.csv | rename ip as query | fields query ] | top 20 srcIP dstIP srcPORT dstPORT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this search does not work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="my_summary" [| inputlookup lookup.csv | rename ip as query | fields query source ] | top 20 srcIP dstIP srcPORT dstPORT source
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;how do I do a lookup for the ip and tie the ip the the source from the lookup table?&lt;BR /&gt;
should I be using a join statement rather than a lookup?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2013 20:45:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Complex-lookup-table-question/m-p/45171#M10681</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-08-23T20:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Complex lookup table question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Complex-lookup-table-question/m-p/45172#M10682</link>
      <description>&lt;P&gt;index="my_summary" source[| inputlookup lookup.csv | fields source ] &lt;/P&gt;

&lt;P&gt;or you should give it a go with proper lookup definition&lt;/P&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
[src]&lt;BR /&gt;
Lookup-s=Source_Lkp source as  srcIP dstIP srcPORT dstPORT&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;BR /&gt;
[Source_Lkp]&lt;BR /&gt;
filename= lookup.csv&lt;/P&gt;

&lt;P&gt;assuming you have source in your eventdata&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2013 21:24:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Complex-lookup-table-question/m-p/45172#M10682</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2013-08-23T21:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Complex lookup table question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Complex-lookup-table-question/m-p/45173#M10683</link>
      <description>&lt;P&gt;linu, sorry the source is only in the look-up table&lt;/P&gt;

&lt;P&gt;I have an IP and I know where the IP came from.&lt;BR /&gt;
I want to look for that IP in my events then display a table of the event data.  I also want to know where I got the IP i was looking for, (the source) in the table. that way people looking at the report would know why I was looking for this particular IP. &lt;/P&gt;

&lt;P&gt;I know how to search events for the IP from the lookup but then how to pass the source to the events so that I can use it in the report on those events I don't know?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2013 13:52:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Complex-lookup-table-question/m-p/45173#M10683</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-08-26T13:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Complex lookup table question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Complex-lookup-table-question/m-p/45174#M10684</link>
      <description>&lt;P&gt;It's the same i guess,&lt;/P&gt;

&lt;P&gt;change my lookup definition &lt;/P&gt;

&lt;P&gt;Lookup-s=Source_Lkp srcIP as source&lt;/P&gt;

&lt;P&gt;You can't replace the ip by source in the original event, but you can format and show it in a table&lt;/P&gt;

&lt;P&gt;...|Table srcIP dstIP srcPORT dstPORT source|...&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2013 14:49:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Complex-lookup-table-question/m-p/45174#M10684</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2013-08-26T14:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Complex lookup table question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Complex-lookup-table-question/m-p/45175#M10685</link>
      <description>&lt;P&gt;Lucky for you, this is a simple syntax question. A join won't work unless the fieldnames match.&lt;/P&gt;

&lt;P&gt;Familiarize yourself with the fundamentals of subsearching:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Tutorial/Useasubsearch"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Tutorial/Useasubsearch&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;and lookups:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Addfieldsfromexternaldatasources"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Addfieldsfromexternaldatasources&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Anytime you do a lookup or a subsearch, in order to match/filter, &lt;STRONG&gt;your fields have to match&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;Your main search is as follows:&lt;BR /&gt;
&lt;PRE&gt;index="my_summary" [| inputlookup lookup.csv | rename ip as query | fields query source ] &lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;In this example, you've queried Splunk, &lt;EM&gt;"given values for the fields 'query' and 'source' in lookup table 'lookup.csv,' find me results in index 'my_summary.'"&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;This is your problem. Since you're looking to filter against any of the following fields &lt;EM&gt;srcIP, dstIP, srcPORT, dstPORT, source&lt;/EM&gt;, those are fields that need to homogenize between your lookup table and event data. Those fields may only exist in your event data, but not your lookup, which is why you renamed the &lt;EM&gt;ip&lt;/EM&gt; field.&lt;/P&gt;

&lt;P&gt;Are you looking to match resultant data with a lookup &lt;EM&gt;or&lt;/EM&gt; use the lookup to look for only that matches? Subtle, but distinct difference for your search, depending on size of data we're talking about here.&lt;/P&gt;

&lt;P&gt;You can get very similar data either way, but I'll let you decide which between the chicken or egg comes first.&lt;/P&gt;

&lt;P&gt;Try something like this:&lt;BR /&gt;
&lt;PRE&gt;index="my_summary" | lookup lookup.csv ip as srcIP | top 20 srcIP dstIP srcPORT dstPORT&lt;/PRE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2013 00:40:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Complex-lookup-table-question/m-p/45175#M10685</guid>
      <dc:creator>hcanivel</dc:creator>
      <dc:date>2013-08-27T00:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Complex lookup table question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Complex-lookup-table-question/m-p/45176#M10686</link>
      <description>&lt;P&gt;Thanks for the help I have a different issue with the lookup table.  I have two values that I want to pass from the lookup table to the search.  the first value "ip" to do a sub-search of the events then the second value "source" to apend to the events found with the "ip" value. &lt;/P&gt;

&lt;P&gt;I hope this makes sense?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2013 15:16:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Complex-lookup-table-question/m-p/45176#M10686</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-08-29T15:16:48Z</dc:date>
    </item>
  </channel>
</rss>

