<?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 how to use scripted input for refreshing lookup data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-scripted-input-for-refreshing-lookup-data/m-p/63620#M15718</link>
    <description>&lt;P&gt;I have two files &lt;CODE&gt;test1.csv&lt;/CODE&gt; and &lt;CODE&gt;test2.csv&lt;/CODE&gt;. I indexed them in Splunk and then use them as lookup. These two files are refreshed everyday with updated data. What i want to do is refresh my lookups with new data in csv files. Here is what i came up with and put in &lt;CODE&gt;refresh.bat&lt;/CODE&gt; files.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     generatetest1.csv
     generatetest2.csv
    ./splunk stop
    ./splunk clean eventdata -index test1_index -f
    ./splunk clean eventdata -index test2_index -f
    ./splunk start
    ./splunk add oneshot "C:\downloads\proto_data\csv\test1.csv" -sourcetype csv -index test1_index -rename-source test1  -auth admin:changeme
    ./splunk search "index=test1_index | outputlookup test1lookup.csv" -auth admin:changeme

./splunk add oneshot C:\downloads\proto_data\csv\test2.csv -sourcetype csv -index test2_index -rename-source test2  -auth admin:changeme
./splunk search "index=test2_index | outputlookup test2lookup.csv" -auth admin:changeme
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have two questions:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;is this the right way to do?&lt;/LI&gt;
&lt;LI&gt;if yes, how can i modify above script such that instead of calling generatetest1.csv and generatetest2.csv and creating test1.csv and test2.csv i can use scripted input and refresh my lookups.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
    <pubDate>Wed, 24 Aug 2011 15:35:11 GMT</pubDate>
    <dc:creator>desi</dc:creator>
    <dc:date>2011-08-24T15:35:11Z</dc:date>
    <item>
      <title>how to use scripted input for refreshing lookup data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-scripted-input-for-refreshing-lookup-data/m-p/63620#M15718</link>
      <description>&lt;P&gt;I have two files &lt;CODE&gt;test1.csv&lt;/CODE&gt; and &lt;CODE&gt;test2.csv&lt;/CODE&gt;. I indexed them in Splunk and then use them as lookup. These two files are refreshed everyday with updated data. What i want to do is refresh my lookups with new data in csv files. Here is what i came up with and put in &lt;CODE&gt;refresh.bat&lt;/CODE&gt; files.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     generatetest1.csv
     generatetest2.csv
    ./splunk stop
    ./splunk clean eventdata -index test1_index -f
    ./splunk clean eventdata -index test2_index -f
    ./splunk start
    ./splunk add oneshot "C:\downloads\proto_data\csv\test1.csv" -sourcetype csv -index test1_index -rename-source test1  -auth admin:changeme
    ./splunk search "index=test1_index | outputlookup test1lookup.csv" -auth admin:changeme

./splunk add oneshot C:\downloads\proto_data\csv\test2.csv -sourcetype csv -index test2_index -rename-source test2  -auth admin:changeme
./splunk search "index=test2_index | outputlookup test2lookup.csv" -auth admin:changeme
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have two questions:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;is this the right way to do?&lt;/LI&gt;
&lt;LI&gt;if yes, how can i modify above script such that instead of calling generatetest1.csv and generatetest2.csv and creating test1.csv and test2.csv i can use scripted input and refresh my lookups.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2011 15:35:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-use-scripted-input-for-refreshing-lookup-data/m-p/63620#M15718</guid>
      <dc:creator>desi</dc:creator>
      <dc:date>2011-08-24T15:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to use scripted input for refreshing lookup data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-use-scripted-input-for-refreshing-lookup-data/m-p/63621#M15719</link>
      <description>&lt;P&gt;So there is actually a lookup search cmd which will use a csv for this purpose.  If that doesn't work you can actually  use a scripted lookup.  Take a &lt;A href="http://www.splunk.com/base/Documentation/latest/Knowledge/Addfieldsfromexternaldatasources"&gt;look at the docs&lt;/A&gt;. OR &lt;A href="http://blogs.splunk.com/2009/07/27/enriching-data-with-lookups-part-1/"&gt;this blog post&lt;/A&gt;.  &lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2011 16:56:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-use-scripted-input-for-refreshing-lookup-data/m-p/63621#M15719</guid>
      <dc:creator>melting</dc:creator>
      <dc:date>2011-08-24T16:56:48Z</dc:date>
    </item>
  </channel>
</rss>

