<?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 How to create dump command and put datetime? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-dump-command-and-put-datetime/m-p/301678#M57005</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Ask about basefilename in dump command.&lt;BR /&gt;
I would like to create a file by date with search results and I would like to put the time in basefilename as in the month and date.&lt;BR /&gt;
What should I do?&lt;/P&gt;

&lt;P&gt;My Search is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=_audit 
    | eval date=strftime(_time,"%F %T") 
    | eval _dstpath=strftime(_time, "%Y%m/%d") 
    | dump basefilename=splunk format=csv fields="date, user, action, info, index, sourcetype" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 03 Apr 2018 15:26:33 GMT</pubDate>
    <dc:creator>khyoung7410</dc:creator>
    <dc:date>2018-04-03T15:26:33Z</dc:date>
    <item>
      <title>How to create dump command and put datetime?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-dump-command-and-put-datetime/m-p/301678#M57005</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Ask about basefilename in dump command.&lt;BR /&gt;
I would like to create a file by date with search results and I would like to put the time in basefilename as in the month and date.&lt;BR /&gt;
What should I do?&lt;/P&gt;

&lt;P&gt;My Search is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=_audit 
    | eval date=strftime(_time,"%F %T") 
    | eval _dstpath=strftime(_time, "%Y%m/%d") 
    | dump basefilename=splunk format=csv fields="date, user, action, info, index, sourcetype" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Apr 2018 15:26:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-dump-command-and-put-datetime/m-p/301678#M57005</guid>
      <dc:creator>khyoung7410</dc:creator>
      <dc:date>2018-04-03T15:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to create dump command and put datetime?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-dump-command-and-put-datetime/m-p/301679#M57006</link>
      <description>&lt;P&gt;The only thing I can think of is to create a macro, since the dump command does not accept variables directly.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Example&lt;/STRONG&gt;:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4661i6C9FFDABE560AAD3/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;You can then do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yoursearch&amp;gt; | eval myFileName="DumpFile_".strftime(now(),"%Y%m%d") | `dumpWithFilename(myFileName)`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Adjust your macro to include other parameters as needed.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 17:38:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-dump-command-and-put-datetime/m-p/301679#M57006</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2018-04-03T17:38:58Z</dc:date>
    </item>
  </channel>
</rss>

