<?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: Append Custom Rows to Lookup Table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Append-Custom-Rows-to-Lookup-Table/m-p/247449#M73819</link>
    <description>&lt;P&gt;You can use the &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Outputlookup"&gt;outputlookup&lt;/A&gt; command if you want to append results.&lt;/P&gt;

&lt;P&gt;Or, there is a really cool lookup editor available here -&amp;gt; &lt;A href="https://splunkbase.splunk.com/app/1724/"&gt;https://splunkbase.splunk.com/app/1724/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Aug 2016 22:39:37 GMT</pubDate>
    <dc:creator>jconger</dc:creator>
    <dc:date>2016-08-25T22:39:37Z</dc:date>
    <item>
      <title>Append Custom Rows to Lookup Table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-Custom-Rows-to-Lookup-Table/m-p/247448#M73818</link>
      <description>&lt;P&gt;I have a lookup table which was created manually in excel and then ported into Splunk as a lookup table via "Add New" lookup files. As I cannot get the results for the lookup by querying in Splunk (information being brought in from elsewhere that isn't logged) I am having trouble figuring out how to add rows as needed.&lt;/P&gt;

&lt;P&gt;Question:&lt;BR /&gt;
Is there a way to add a row to a lookup table when you can't query for the table results outside the lookup itself?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 22:34:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-Custom-Rows-to-Lookup-Table/m-p/247448#M73818</guid>
      <dc:creator>pepper_seattle</dc:creator>
      <dc:date>2016-08-25T22:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Append Custom Rows to Lookup Table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-Custom-Rows-to-Lookup-Table/m-p/247449#M73819</link>
      <description>&lt;P&gt;You can use the &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Outputlookup"&gt;outputlookup&lt;/A&gt; command if you want to append results.&lt;/P&gt;

&lt;P&gt;Or, there is a really cool lookup editor available here -&amp;gt; &lt;A href="https://splunkbase.splunk.com/app/1724/"&gt;https://splunkbase.splunk.com/app/1724/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 22:39:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-Custom-Rows-to-Lookup-Table/m-p/247449#M73819</guid>
      <dc:creator>jconger</dc:creator>
      <dc:date>2016-08-25T22:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Append Custom Rows to Lookup Table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-Custom-Rows-to-Lookup-Table/m-p/247450#M73820</link>
      <description>&lt;P&gt;I know about outputlookup, but I'm not sure how to append a row with custom data. Most examples have you query your data and update tables with the results of the query. If I can't query for my data, then what do I do?&lt;/P&gt;

&lt;P&gt;Looking into that tool, thanks for pointing it out!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 22:55:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-Custom-Rows-to-Lookup-Table/m-p/247450#M73820</guid>
      <dc:creator>pepper_seattle</dc:creator>
      <dc:date>2016-08-25T22:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Append Custom Rows to Lookup Table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-Custom-Rows-to-Lookup-Table/m-p/247451#M73821</link>
      <description>&lt;P&gt;You can do it in search as well.  Let's say you have a CSV that was imported that looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;thing,color,weight
1,blue,"1.1"
2,green,"2.2"
3,red,"3.3"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, you can run the following search to view the CSV, append some made up results, dedup the data (by using stats count), and write it all back to the original CSV:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup things.csv | append [ | stats count | eval thing=4 | eval color="purple" | eval weight=4.4 ] | stats count by thing color weight | fields - count | output lookup things.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After running that search, the CSV looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;thing,color,weight
1,blue,"1.1"
2,green,"2.2"
3,red,"3.3"
4,purple,"4.4"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Aug 2016 23:29:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-Custom-Rows-to-Lookup-Table/m-p/247451#M73821</guid>
      <dc:creator>jconger</dc:creator>
      <dc:date>2016-08-25T23:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Append Custom Rows to Lookup Table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-Custom-Rows-to-Lookup-Table/m-p/247452#M73822</link>
      <description>&lt;P&gt;That worked! Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 17:14:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-Custom-Rows-to-Lookup-Table/m-p/247452#M73822</guid>
      <dc:creator>pepper_seattle</dc:creator>
      <dc:date>2016-08-26T17:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Append Custom Rows to Lookup Table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-Custom-Rows-to-Lookup-Table/m-p/247453#M73823</link>
      <description>&lt;P&gt;Another hack, is you could select one entry from the lookup table, modify the field values with "eval" commands, then append to the original lookup table.&lt;/P&gt;

&lt;P&gt;Considering things-table.csv:&lt;BR /&gt;
    thing,color,weight&lt;BR /&gt;
    1,blue,"1.1"&lt;BR /&gt;
    2,green,"2.2"&lt;BR /&gt;
    3,red,"3.3"&lt;/P&gt;

&lt;P&gt;The following command will lookup the first entry, modify it, then append to the lookup table:&lt;BR /&gt;
    | inputlookup things-table.csv&lt;BR /&gt;
    | search thing=1&lt;BR /&gt;
    | eval thing="4",color="purple",weight="4.4"&lt;BR /&gt;
    | outputlookup append=t things-table.csv&lt;/P&gt;

&lt;P&gt;Then "|inputlookup things-table.csv" will have the output:&lt;BR /&gt;
    thing,color,weight&lt;BR /&gt;
    1,blue,"1.1"&lt;BR /&gt;
    2,green,"2.2"&lt;BR /&gt;
    3,red,"3.3"&lt;BR /&gt;
    4,purple,"4.4"&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 00:01:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-Custom-Rows-to-Lookup-Table/m-p/247453#M73823</guid>
      <dc:creator>bwlm</dc:creator>
      <dc:date>2019-03-20T00:01:55Z</dc:date>
    </item>
  </channel>
</rss>

