<?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 n strings for n months? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-n-strings-for-n-months/m-p/409372#M118095</link>
    <description>&lt;P&gt;I need to create monthly filenames (2018-06-01.csv, 2018-07-01.csv, etc.) for n months. I can do something similar by day with n=30:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval count=mvrange(0,30,1) | mvexpand count | eval filename=strftime(now()-count\*86400
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do I do this by month, something similar to the below syntax?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval count=mvrange(0,12,1) | mvexpand count | eval filename=strftime(relative_time(now(), count \* "-1mon")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 15 Aug 2018 21:25:18 GMT</pubDate>
    <dc:creator>nick405060</dc:creator>
    <dc:date>2018-08-15T21:25:18Z</dc:date>
    <item>
      <title>How to create n strings for n months?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-n-strings-for-n-months/m-p/409372#M118095</link>
      <description>&lt;P&gt;I need to create monthly filenames (2018-06-01.csv, 2018-07-01.csv, etc.) for n months. I can do something similar by day with n=30:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval count=mvrange(0,30,1) | mvexpand count | eval filename=strftime(now()-count\*86400
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do I do this by month, something similar to the below syntax?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval count=mvrange(0,12,1) | mvexpand count | eval filename=strftime(relative_time(now(), count \* "-1mon")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Aug 2018 21:25:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-n-strings-for-n-months/m-p/409372#M118095</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2018-08-15T21:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to create n strings for n months?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-n-strings-for-n-months/m-p/409373#M118096</link>
      <description>&lt;P&gt;Turns out it was pretty easy:&lt;/P&gt;

&lt;P&gt;| makeresults | eval count=mvrange(0,12,1) | mvexpand count | eval modifier="-"+tostring(count)+"mon" | eval filename=strftime(relative_time(now(),modifier),"%Y-%m-%d.csv")&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 22:43:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-n-strings-for-n-months/m-p/409373#M118096</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2018-08-15T22:43:29Z</dc:date>
    </item>
  </channel>
</rss>

