<?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: outputlookup append one field but not another in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/outputlookup-append-one-field-but-not-another/m-p/513099#M143960</link>
    <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;outputlookup&lt;/FONT&gt; command replaces the entire lookup file, unless you the &lt;FONT face="courier new,courier"&gt;append=true&lt;/FONT&gt; option.&lt;/P&gt;&lt;P&gt;To replace parts of the lookup, you have to read in the lookup file, make the changes using SPL, and then write the lookup.&amp;nbsp; That looks like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup asset_score.csv
| append [ search index=* host=* 
  | table host weight1 ]
| dedup host 
| rename host AS asset
| outputlookup append=false asset_score.csv&lt;/LI-CODE&gt;&lt;P&gt;This query should retain rows from the lookup file while adding new hosts from the search.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Aug 2020 21:08:46 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-08-07T21:08:46Z</dc:date>
    <item>
      <title>outputlookup append one field but not another</title>
      <link>https://community.splunk.com/t5/Splunk-Search/outputlookup-append-one-field-but-not-another/m-p/513098#M143959</link>
      <description>&lt;P&gt;I am trying to write a search that will update a lookup asset table, with an additional table column metric (weight1). However, I want to be able to append the asset column, without the 2nd column being appended.&lt;/P&gt;&lt;P&gt;Is this possible?&amp;nbsp;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* host=* | table host weight1| dedup host | rename host AS asset| outputlookup append=false asset_score.csv&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;This will run as a saved search to update the lookup table periodically.&lt;/P&gt;&lt;P&gt;However, if I modify the "weight1" column values in lookupeditor, the changes get wiped out whenever the above saved search runs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 20:59:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/outputlookup-append-one-field-but-not-another/m-p/513098#M143959</guid>
      <dc:creator>daniel_althoff8</dc:creator>
      <dc:date>2020-08-07T20:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: outputlookup append one field but not another</title>
      <link>https://community.splunk.com/t5/Splunk-Search/outputlookup-append-one-field-but-not-another/m-p/513099#M143960</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;outputlookup&lt;/FONT&gt; command replaces the entire lookup file, unless you the &lt;FONT face="courier new,courier"&gt;append=true&lt;/FONT&gt; option.&lt;/P&gt;&lt;P&gt;To replace parts of the lookup, you have to read in the lookup file, make the changes using SPL, and then write the lookup.&amp;nbsp; That looks like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup asset_score.csv
| append [ search index=* host=* 
  | table host weight1 ]
| dedup host 
| rename host AS asset
| outputlookup append=false asset_score.csv&lt;/LI-CODE&gt;&lt;P&gt;This query should retain rows from the lookup file while adding new hosts from the search.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 21:08:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/outputlookup-append-one-field-but-not-another/m-p/513099#M143960</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-08-07T21:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: outputlookup append one field but not another</title>
      <link>https://community.splunk.com/t5/Splunk-Search/outputlookup-append-one-field-but-not-another/m-p/513105#M143963</link>
      <description>&lt;P&gt;The above suggestion still wipes out the "weight1" values from the lookup editor every time that search is ran.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The goal is this---&lt;/P&gt;&lt;P&gt;Create a search that creates a lookup table of all hosts in the environment, and assign a value to each host. The search will run on a schedule so that any time a new host is created, the lookup table gets populated with that new host/ asset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to assign a # value (that can be edited) to each host in the lookup table, that can be used and queried against for other metrics later on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the search needs to populate just the "asset" column, but not modify the "weight" column everytime the search is ran.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 21:35:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/outputlookup-append-one-field-but-not-another/m-p/513105#M143963</guid>
      <dc:creator>daniel_althoff8</dc:creator>
      <dc:date>2020-08-07T21:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: outputlookup append one field but not another</title>
      <link>https://community.splunk.com/t5/Splunk-Search/outputlookup-append-one-field-but-not-another/m-p/513172#M143975</link>
      <description>&lt;P&gt;Let's try something a little different.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup asset_score.csv
| append [ search index=* host=* 
  | eval weight1 = 0
  | table host weight1 ]
| sort - host weight1
| dedup host 
| rename host AS asset
| outputlookup append=false asset_score.csv&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After the sort we should have a list of hosts and weights.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;foo     10
foo     0
bar     5
bar     0
baz     0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dedup will yield the unique host names, along with their associated weights.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;foo     10
bar     5
baz     0&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 08 Aug 2020 23:29:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/outputlookup-append-one-field-but-not-another/m-p/513172#M143975</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-08-08T23:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: outputlookup append one field but not another</title>
      <link>https://community.splunk.com/t5/Splunk-Search/outputlookup-append-one-field-but-not-another/m-p/513449#M144061</link>
      <description>&lt;P&gt;Unfortunately, I am still getting the same issue. Where every time the search is ran, now the eval stanza forces the weight back to 0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to be able to edit the lookup table, but when the search runs, my edits wont change.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The goal is to run a saved search to automatically add any new host (and not duplicate the host list) to the lookup table list with a default weight value, and then modify the weight values manually, but not have them revert back to the default weight value.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 21:33:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/outputlookup-append-one-field-but-not-another/m-p/513449#M144061</guid>
      <dc:creator>daniel_althoff8</dc:creator>
      <dc:date>2020-08-10T21:33:13Z</dc:date>
    </item>
  </channel>
</rss>

