<?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: Creating unique file name for outputcsv in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45933#M10963</link>
    <description>&lt;P&gt;try this instead for creating the file name&lt;/P&gt;

&lt;P&gt;...| outputcsv [ | stats count | eval filename=strftime(now(), "All_lab_new_%b_%d_%Y") | return $filename]&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 13:24:25 GMT</pubDate>
    <dc:creator>cramasta</dc:creator>
    <dc:date>2020-09-28T13:24:25Z</dc:date>
    <item>
      <title>Creating unique file name for outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45928#M10958</link>
      <description>&lt;P&gt;I am trying to use this. It will create a file with the correct file name, it just has no contents... Any Ideas?&lt;/P&gt;

&lt;P&gt;my command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`eval_lab_invalid_chars` | `eval_lab_field_errors` | `remove_inactive_tests` | `lab_table_1` | `compendium_status_3_spaces` | `compendium_filter_status(Good)` | `report_date_grouping_lab` | `new_compendium_filter` | `division_lookup` | `compendium_date_format` | `compendium_new_lab_dedup` | `compendium_new_lab_table` | outputcsv [ search index=compendium sourcetype=lab_compendium | head 1 | eval query="All_lab_new_".strftime(now(),"%b_%d_%Y") | fields query | format "" "" "" "" "" ""]`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I run the search without the outputcsv command I get results...&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2013 16:14:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45928#M10958</guid>
      <dc:creator>ShaneNewman</dc:creator>
      <dc:date>2013-02-27T16:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating unique file name for outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45929#M10959</link>
      <description>&lt;P&gt;so you if you just use  ...|outputcsv somefile.csv &lt;BR /&gt;
does it work?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2013 16:46:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45929#M10959</guid>
      <dc:creator>cramasta</dc:creator>
      <dc:date>2013-02-27T16:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Creating unique file name for outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45930#M10960</link>
      <description>&lt;P&gt;Yes, it will work that way.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2013 16:55:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45930#M10960</guid>
      <dc:creator>ShaneNewman</dc:creator>
      <dc:date>2013-02-27T16:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Creating unique file name for outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45931#M10961</link>
      <description>&lt;P&gt;what is the custom name you are trying to accomplish?&lt;BR /&gt;
All_lab_new_feb_27_2013.csv ?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:24:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45931#M10961</guid>
      <dc:creator>cramasta</dc:creator>
      <dc:date>2020-09-28T13:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Creating unique file name for outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45932#M10962</link>
      <description>&lt;P&gt;That is correct, for 450 searches. This file will be used to maintain integrations.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2013 17:04:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45932#M10962</guid>
      <dc:creator>ShaneNewman</dc:creator>
      <dc:date>2013-02-27T17:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating unique file name for outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45933#M10963</link>
      <description>&lt;P&gt;try this instead for creating the file name&lt;/P&gt;

&lt;P&gt;...| outputcsv [ | stats count | eval filename=strftime(now(), "All_lab_new_%b_%d_%Y") | return $filename]&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:24:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45933#M10963</guid>
      <dc:creator>cramasta</dc:creator>
      <dc:date>2020-09-28T13:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating unique file name for outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45934#M10964</link>
      <description>&lt;P&gt;Tried that too, same result.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2013 17:11:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45934#M10964</guid>
      <dc:creator>ShaneNewman</dc:creator>
      <dc:date>2013-02-27T17:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: Creating unique file name for outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45935#M10965</link>
      <description>&lt;P&gt;strange, what version are you running?&lt;BR /&gt;
and to just be clear, when you define the file name like outputcsv filename.csv &lt;BR /&gt;
its works&lt;BR /&gt;
but when you use the unique name its a blank file?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2013 17:16:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45935#M10965</guid>
      <dc:creator>cramasta</dc:creator>
      <dc:date>2013-02-27T17:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating unique file name for outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45936#M10966</link>
      <description>&lt;P&gt;We are on 4.3.5&lt;/P&gt;

&lt;P&gt;That is correct, if I use a static file name it works fine. When using the dynamic name I get a blank file.&lt;/P&gt;

&lt;P&gt;I think we are just going to use PowerShell to add the date stamp to the file, after it is generated.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2013 17:18:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45936#M10966</guid>
      <dc:creator>ShaneNewman</dc:creator>
      <dc:date>2013-02-27T17:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating unique file name for outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45937#M10967</link>
      <description>&lt;P&gt;very strange I have not had that happen in my experience so far.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2013 19:18:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45937#M10967</guid>
      <dc:creator>cramasta</dc:creator>
      <dc:date>2013-02-27T19:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating unique file name for outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45938#M10968</link>
      <description>&lt;P&gt;I keep hearing that about a lot of the issues we deal with. I am beginning to wonder if there is something wrong with Windows!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2013 19:20:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45938#M10968</guid>
      <dc:creator>ShaneNewman</dc:creator>
      <dc:date>2013-02-27T19:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating unique file name for outputcsv</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45939#M10969</link>
      <description>&lt;P&gt;We ended up using PowerShell to do the renames and moving the files to the Shared Location that we wanted to use. Changed outputcsv to outputlookup and setup some transforms.conf to setup the initial location of the files.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2013 17:06:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-unique-file-name-for-outputcsv/m-p/45939#M10969</guid>
      <dc:creator>ShaneNewman</dc:creator>
      <dc:date>2013-03-05T17:06:01Z</dc:date>
    </item>
  </channel>
</rss>

