<?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 do I update a lookup file with updated information in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-update-a-lookup-file-with-updated-information/m-p/690711#M235237</link>
    <description>&lt;P&gt;How i update the&amp;nbsp;test_MID_IP.csv&amp;nbsp; with the output IP, so that next time it runs with updated list&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=abc IP!="10.*" [| inputlookup ip_tracking.csv | rename test_DATA AS MID | format ] | lookup test_MID_IP.csv test_IP as IP OUTPUT test_IP | eval match=if('IP'== test_IP, "yes", "no")| search match=no | stats count by IP&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 14 Jun 2024 12:03:38 GMT</pubDate>
    <dc:creator>RahulMisra1</dc:creator>
    <dc:date>2024-06-14T12:03:38Z</dc:date>
    <item>
      <title>How do I update a lookup file with updated information</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-update-a-lookup-file-with-updated-information/m-p/445428#M126348</link>
      <description>&lt;P&gt;I have a lookup file that contains two columns, ip and mac.  I want to update this file daily by running a query that catches when either a new device is added or an existing device is moved.  My query is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=syslog logdesc="neighbor table change" vendor_action="add"
| regex srcip = "(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"
| stats latest(srcip) BY mac
| rename "latest(srcip)" AS srcip
| fields mac srcip 
| lookup srcip_mac.csv mac OUTPUTNEW srcip 
| outputlookup append=true srcip_mac.csv 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What happens is that I end up with a file that contains the updated data in a new line but the existing items are duplicated.  I end up with a file that is twice the size it needs to be.  &lt;/P&gt;

&lt;P&gt;Any help will be greatly appreciated.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Scott &lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2019 19:31:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-update-a-lookup-file-with-updated-information/m-p/445428#M126348</guid>
      <dc:creator>scottrunyon</dc:creator>
      <dc:date>2019-06-28T19:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I update a lookup file with updated information</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-update-a-lookup-file-with-updated-information/m-p/445429#M126349</link>
      <description>&lt;P&gt;Your query needs to read the existing lookup, read the new events, dedup the results, then write to the lookup file.  Something like this:&lt;/P&gt;

&lt;P&gt;index=syslog logdesc="neighbor table change" vendor_action="add"&lt;BR /&gt;
| regex srcip = "(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})"&lt;BR /&gt;
| stats latest(srcip) BY mac&lt;BR /&gt;
| rename "latest(srcip)" AS srcip&lt;BR /&gt;
| fields mac srcip &lt;BR /&gt;
| intputlookup append=true srcip_mac.csv&lt;BR /&gt;
| dedup srcip&lt;BR /&gt;
| outputlookup srcip_mac.csv &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:08:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-update-a-lookup-file-with-updated-information/m-p/445429#M126349</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-09-30T01:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I update a lookup file with updated information</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-update-a-lookup-file-with-updated-information/m-p/650189#M224787</link>
      <description>&lt;P&gt;Four years later and this post is still helping people.&amp;nbsp; Thanks very much, friend!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 13:49:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-update-a-lookup-file-with-updated-information/m-p/650189#M224787</guid>
      <dc:creator>jmcnutt</dc:creator>
      <dc:date>2023-07-12T13:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I update a lookup file with updated information</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-update-a-lookup-file-with-updated-information/m-p/690630#M235209</link>
      <description>&lt;P&gt;I am running this. how can i append the IP form below query to&amp;nbsp;test.csv&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=&amp;lt;abc&amp;gt;[| inputlookup ip_tracking.csv | rename FDS AS MID | format ] | lookup test.csv test_IP as IP OUTPUT test_IP | eval match=if('IP'== test_IP, "yes", "no")| search match=no | stats count by IP



&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 13 Jun 2024 14:27:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-update-a-lookup-file-with-updated-information/m-p/690630#M235209</guid>
      <dc:creator>RahulMisra1</dc:creator>
      <dc:date>2024-06-13T14:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I update a lookup file with updated information</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-update-a-lookup-file-with-updated-information/m-p/690711#M235237</link>
      <description>&lt;P&gt;How i update the&amp;nbsp;test_MID_IP.csv&amp;nbsp; with the output IP, so that next time it runs with updated list&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=abc IP!="10.*" [| inputlookup ip_tracking.csv | rename test_DATA AS MID | format ] | lookup test_MID_IP.csv test_IP as IP OUTPUT test_IP | eval match=if('IP'== test_IP, "yes", "no")| search match=no | stats count by IP&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 14 Jun 2024 12:03:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-update-a-lookup-file-with-updated-information/m-p/690711#M235237</guid>
      <dc:creator>RahulMisra1</dc:creator>
      <dc:date>2024-06-14T12:03:38Z</dc:date>
    </item>
  </channel>
</rss>

