<?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: Add columns from lookup file in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Add-columns-from-lookup-file/m-p/709505#M239800</link>
    <description>&lt;P&gt;There is minor issue with the lookup command syntax.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;| lookup tcp-udp port OUTPUT description&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after lookup name there should be the field which is common between lookup and splunk data, which in our case is port number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lookup Command Doc - &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Lookup" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Lookup&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!!! Kindly upvote if it does!!&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jan 2025 19:06:16 GMT</pubDate>
    <dc:creator>VatsalJagani</dc:creator>
    <dc:date>2025-01-22T19:06:16Z</dc:date>
    <item>
      <title>Add columns from lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-columns-from-lookup-file/m-p/709502#M239799</link>
      <description>&lt;P&gt;Combing through firewall logs.&amp;nbsp; I am extracting source, destination, dest_port.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a csv lookup file with ports and descriptions of those ports, both udp and tcp.&amp;nbsp; &amp;nbsp;I want to take the description from the lookup and add to the results in a table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my search:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| stats count by SRC, DST, DEST_PORT
| lookup tcp-udp description OUTPUT description AS desc, port
| eval desc=if(DPT = port, description, "not ok")
| table SRC, DST, DEST_PORT, port, desc&lt;/LI-CODE&gt;
&lt;P&gt;the port and desc field are blank and say "not ok" respectively.&amp;nbsp; I'm stuck...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 19:23:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-columns-from-lookup-file/m-p/709502#M239799</guid>
      <dc:creator>ronj_clark</dc:creator>
      <dc:date>2025-01-22T19:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Add columns from lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-columns-from-lookup-file/m-p/709505#M239800</link>
      <description>&lt;P&gt;There is minor issue with the lookup command syntax.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;| lookup tcp-udp port OUTPUT description&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after lookup name there should be the field which is common between lookup and splunk data, which in our case is port number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lookup Command Doc - &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Lookup" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Lookup&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!!! Kindly upvote if it does!!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 19:06:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-columns-from-lookup-file/m-p/709505#M239800</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2025-01-22T19:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Add columns from lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-columns-from-lookup-file/m-p/709506#M239801</link>
      <description>&lt;P&gt;You're asking the &lt;FONT face="courier new,courier"&gt;lookup&lt;/FONT&gt; command to find the description field, but the field doesn't exist yet.&amp;nbsp; The lookup command needs an input field which it will then search for in the given lookup table.&amp;nbsp; It returns the requested fields that are in the same row as the located input field.&lt;/P&gt;&lt;P&gt;In the example, we probably want the description associated with the destination port.&amp;nbsp; If so, the command might look like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| lookup tcp-udp DEST_PORT as port OUTPUT description AS desc, port&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Also, the DPT field in the &lt;FONT face="courier new,courier"&gt;eval&lt;/FONT&gt; command doesn't exist so the &lt;FONT face="courier new,courier"&gt;if &lt;/FONT&gt;will always evaluate to false.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 19:12:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-columns-from-lookup-file/m-p/709506#M239801</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2025-01-22T19:12:22Z</dc:date>
    </item>
  </channel>
</rss>

