<?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: Automatic lookup, matching range field? in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Automatic-lookup-matching-range-field/m-p/422493#M5841</link>
    <description>&lt;P&gt;It sounds like a job for a lookup table. I don't know if you can do ranges in a lookup table..&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.1.2/Knowledge/LookupexampleinSplunkWeb"&gt;https://docs.splunk.com/Documentation/Splunk/7.1.2/Knowledge/LookupexampleinSplunkWeb&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You may have to have a line entry for each port in the csv file to get it working. Not the best solution, but it is simple and might be the only solution.&lt;/P&gt;

&lt;P&gt;So your csv lookup file might look like...  And with excel if you enter two cells with consecutive numbers, you can click the corner and drag down to populate up to the number you like. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;port,servicename
1024,ServiceA
1025,ServiceA
1026,ServiceA
1027,ServiceA
1028,ServiceA
1029,ServiceA
1030,ServiceA
1031,ServiceA
1032,ServiceA
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;etc...&lt;/P&gt;

&lt;P&gt;Then you can either do an inline |inputlookup or do an automatic search that will create a new field called "ServiceName" or whatever. &lt;/P&gt;</description>
    <pubDate>Tue, 21 Aug 2018 17:13:08 GMT</pubDate>
    <dc:creator>JDukeSplunk</dc:creator>
    <dc:date>2018-08-21T17:13:08Z</dc:date>
    <item>
      <title>Automatic lookup, matching range field?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Automatic-lookup-matching-range-field/m-p/422492#M5840</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I would like to enriche netflow data (i.e. dst ip, dst port) with "service name", using automatic lookup.&lt;BR /&gt;
My lookup looks like the following example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;IP             PORT_RANGE         SERVICENAME
x.x.x.x/32     1024,1048          ServiceA
y.y.y.y/30     80,80              ServiceB
z.z.z.z/31     8000,8999          ServiceC
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR the lookup could be with two PORT fields:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;IP             PORT_MIN      PORT_MAX     SERVICENAME
x.x.x.x/32     1024          1048         ServiceA
y.y.y.y/30     80            80           ServiceB
z.z.z.z/31     8000          8999         ServiceC
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Matching the IP is easy with match_type CIDR, BUT how-to match the port range???&lt;BR /&gt;
Don't mind which of the two examples above to implement a solution for &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
Or the solution could be a complete 3th solution.&lt;/P&gt;

&lt;P&gt;Looking forward fore some bright answers,&lt;BR /&gt;
Thanks,&lt;BR /&gt;
//Torben&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 13:27:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Automatic-lookup-matching-range-field/m-p/422492#M5840</guid>
      <dc:creator>drejoe</dc:creator>
      <dc:date>2018-08-21T13:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic lookup, matching range field?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Automatic-lookup-matching-range-field/m-p/422493#M5841</link>
      <description>&lt;P&gt;It sounds like a job for a lookup table. I don't know if you can do ranges in a lookup table..&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.1.2/Knowledge/LookupexampleinSplunkWeb"&gt;https://docs.splunk.com/Documentation/Splunk/7.1.2/Knowledge/LookupexampleinSplunkWeb&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You may have to have a line entry for each port in the csv file to get it working. Not the best solution, but it is simple and might be the only solution.&lt;/P&gt;

&lt;P&gt;So your csv lookup file might look like...  And with excel if you enter two cells with consecutive numbers, you can click the corner and drag down to populate up to the number you like. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;port,servicename
1024,ServiceA
1025,ServiceA
1026,ServiceA
1027,ServiceA
1028,ServiceA
1029,ServiceA
1030,ServiceA
1031,ServiceA
1032,ServiceA
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;etc...&lt;/P&gt;

&lt;P&gt;Then you can either do an inline |inputlookup or do an automatic search that will create a new field called "ServiceName" or whatever. &lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 17:13:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Automatic-lookup-matching-range-field/m-p/422493#M5841</guid>
      <dc:creator>JDukeSplunk</dc:creator>
      <dc:date>2018-08-21T17:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic lookup, matching range field?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Automatic-lookup-matching-range-field/m-p/422494#M5842</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Thanks for the answer.&lt;/P&gt;

&lt;P&gt;I've already tried this solution (before posting the question) with one line per port. But the amount of combinations is huge - millions of lines which won't work at all.&lt;/P&gt;

&lt;P&gt;That's why I need another solution - a solution that can handle this ranges instead of "unfolding" all combinations.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 20:15:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Automatic-lookup-matching-range-field/m-p/422494#M5842</guid>
      <dc:creator>drejoe</dc:creator>
      <dc:date>2018-08-21T20:15:43Z</dc:date>
    </item>
  </channel>
</rss>

