<?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: outputcsv - append field value in filename in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/outputcsv-append-field-value-in-filename/m-p/386983#M95182</link>
    <description>&lt;P&gt;Hi @vb1612,&lt;/P&gt;

&lt;P&gt;Where is your field located ? Is it in an index ? Are you trying to combine fields from multiple sources ?&lt;/P&gt;

&lt;P&gt;Official documentation for output CSV is in Splunk docs : &lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/SearchReference/Outputcsv"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.6/SearchReference/Outputcsv&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;So all you have to do is make sure your field is there before you run the outputcsv command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=yourindex sourcetype=yoursourcetype | fields fields_you_want_to_keep | outputcsv MyTestCsvFile
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Pease provide some sample data if you want you help with your specific SPL.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
    <pubDate>Sun, 26 May 2019 07:24:16 GMT</pubDate>
    <dc:creator>DavidHourani</dc:creator>
    <dc:date>2019-05-26T07:24:16Z</dc:date>
    <item>
      <title>outputcsv - append field value in filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/outputcsv-append-field-value-in-filename/m-p/386982#M95181</link>
      <description>&lt;P&gt;I have field name xyz , want to append value of this field in outputcsv filename&lt;/P&gt;</description>
      <pubDate>Sun, 26 May 2019 01:25:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/outputcsv-append-field-value-in-filename/m-p/386982#M95181</guid>
      <dc:creator>vb1612</dc:creator>
      <dc:date>2019-05-26T01:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: outputcsv - append field value in filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/outputcsv-append-field-value-in-filename/m-p/386983#M95182</link>
      <description>&lt;P&gt;Hi @vb1612,&lt;/P&gt;

&lt;P&gt;Where is your field located ? Is it in an index ? Are you trying to combine fields from multiple sources ?&lt;/P&gt;

&lt;P&gt;Official documentation for output CSV is in Splunk docs : &lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/SearchReference/Outputcsv"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.6/SearchReference/Outputcsv&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;So all you have to do is make sure your field is there before you run the outputcsv command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=yourindex sourcetype=yoursourcetype | fields fields_you_want_to_keep | outputcsv MyTestCsvFile
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Pease provide some sample data if you want you help with your specific SPL.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Sun, 26 May 2019 07:24:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/outputcsv-append-field-value-in-filename/m-p/386983#M95182</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-26T07:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: outputcsv - append field value in filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/outputcsv-append-field-value-in-filename/m-p/386984#M95183</link>
      <description>&lt;P&gt;Something like this..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your_search_to_get_xyz field&amp;gt;
|eval myCSVFile=xyz
| map search="search index=_internal| fields host,sourcetype,source|outputlookup $myCSVFile$.csv"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Above is an example.. Change it to your own searches to generate the xyz field and then apply it to the output of another search to generate outputlookup&lt;/P&gt;</description>
      <pubDate>Sun, 26 May 2019 08:50:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/outputcsv-append-field-value-in-filename/m-p/386984#M95183</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-05-26T08:50:44Z</dc:date>
    </item>
  </channel>
</rss>

