<?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: Specify Fields for Outputlookup or Outputcsv in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Specify-Fields-for-Outputlookup-or-Outputcsv/m-p/29342#M5910</link>
    <description>&lt;P&gt;I downvoted this post because this isn't an elegant solution. I don't want to table my fields before I output because there are other fields that I don't want to output but that I want to keep to do other processing with.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Jan 2019 20:24:10 GMT</pubDate>
    <dc:creator>nick405060</dc:creator>
    <dc:date>2019-01-03T20:24:10Z</dc:date>
    <item>
      <title>Specify Fields for Outputlookup or Outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specify-Fields-for-Outputlookup-or-Outputcsv/m-p/29340#M5908</link>
      <description>&lt;P&gt;How can I get outputlookup or outputcsv to only include certain fields in the resulting lookup file? &lt;/P&gt;

&lt;P&gt;An example explains it better:&lt;/P&gt;

&lt;P&gt;SEARCH | DEDUP FieldName1 | FIELDS FieldName1, FieldName2 | OUTPUTLOOKUP lookupFile.csv&lt;/P&gt;

&lt;P&gt;I want the resulting lookup file to be formatted with just an entry of "FieldValue1, FieldValue2" per line per result. I do not want the full raw logs in the lookup as it seems to be doing.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Aug 2010 03:03:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specify-Fields-for-Outputlookup-or-Outputcsv/m-p/29340#M5908</guid>
      <dc:creator>mattcg</dc:creator>
      <dc:date>2010-08-13T03:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Specify Fields for Outputlookup or Outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specify-Fields-for-Outputlookup-or-Outputcsv/m-p/29341#M5909</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search&amp;gt; | dedup FieldName1 | table FieldName1 FieldName2 | outputlookup mylookup
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Aug 2010 03:07:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specify-Fields-for-Outputlookup-or-Outputcsv/m-p/29341#M5909</guid>
      <dc:creator>ziegfried</dc:creator>
      <dc:date>2010-08-13T03:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: Specify Fields for Outputlookup or Outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specify-Fields-for-Outputlookup-or-Outputcsv/m-p/29342#M5910</link>
      <description>&lt;P&gt;I downvoted this post because this isn't an elegant solution. I don't want to table my fields before I output because there are other fields that I don't want to output but that I want to keep to do other processing with.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 20:24:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specify-Fields-for-Outputlookup-or-Outputcsv/m-p/29342#M5910</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2019-01-03T20:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Specify Fields for Outputlookup or Outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specify-Fields-for-Outputlookup-or-Outputcsv/m-p/521872#M147092</link>
      <description>&lt;P&gt;Did you ever find an answer to this?&amp;nbsp; I wanting to do a similar search.&amp;nbsp; I only want to append specific fields to a lookup table, while keeping the rest of the fields for alert automation.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:43:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specify-Fields-for-Outputlookup-or-Outputcsv/m-p/521872#M147092</guid>
      <dc:creator>n0vsec</dc:creator>
      <dc:date>2020-09-28T17:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Specify Fields for Outputlookup or Outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specify-Fields-for-Outputlookup-or-Outputcsv/m-p/676814#M231458</link>
      <description>&lt;P&gt;| appendpipe [ | fields x y z | outputlookup lookup ]&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 08:37:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specify-Fields-for-Outputlookup-or-Outputcsv/m-p/676814#M231458</guid>
      <dc:creator>mdorobek</dc:creator>
      <dc:date>2024-02-07T08:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: Specify Fields for Outputlookup or Outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Specify-Fields-for-Outputlookup-or-Outputcsv/m-p/676865#M231470</link>
      <description>&lt;P&gt;This is exactly what I was looking for!&amp;nbsp; One interesting thing I noticed, which I am not sure is a bug or not:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If you run &lt;STRONG&gt;outputlook&lt;/STRONG&gt; up and &lt;STRONG&gt;_time&lt;/STRONG&gt; is still in the initial pipeline it will output&amp;nbsp;&lt;STRONG&gt;_time&amp;nbsp;&lt;/STRONG&gt;to the lookup&lt;UL&gt;&lt;LI&gt;This happens even if you explicitly try to remove using the &lt;STRONG&gt;field&lt;/STRONG&gt; command&amp;nbsp;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;A work around would be to rename time, which works but is not ideal&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Also to clean this up since this appends to the results of the initial pipeline you will need to follow with a&amp;nbsp;&lt;STRONG&gt;where isnotnull(a)&lt;/STRONG&gt;, filtering out results on null values that should be present in the appended results.&lt;/P&gt;&lt;P&gt;So the resulting search would be something like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...initial search...
``` If you don't want _time in your resulting lookup ```
| rename _time as time 
| convert ctime(time) 
``` Select fields for outputing to lookup ```
| appendpipe 
    [| fields a, b, c 
    | outputlookup lookup_file]
``` Remove appended entries by filtering on null fields which should only be present in the appended output ```
| where isnotnull(d)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 17:34:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Specify-Fields-for-Outputlookup-or-Outputcsv/m-p/676865#M231470</guid>
      <dc:creator>n0vsec</dc:creator>
      <dc:date>2024-02-07T17:34:06Z</dc:date>
    </item>
  </channel>
</rss>

