<?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 return: eval filename=strftime(now(),  with yesterdays count (as fileinformation) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/return-eval-filename-strftime-now-with-yesterdays-count-as/m-p/484746#M135690</link>
    <description>&lt;P&gt;hello,&lt;/P&gt;

&lt;P&gt;looking for some help.&lt;/P&gt;

&lt;P&gt;I am running a search, daily.... but the logs in the source get updated late by the application (the app updates the source/log-file next day with values related to previous day) , so I want to run my search next day and return the result into an outputlookup.csv incl. the day-count of previous day.&lt;/P&gt;

&lt;P&gt;in example: if my search runs daily ... let's say on day 9 (search is on previous day (8 = yesterday) it returns an outputlookup .csv as: file-name_%d.csv which is equal as file-name_09.csv (works perfectly)&lt;/P&gt;

&lt;P&gt;I need to get it returned as: &lt;STRONG&gt;file-name_08.csv&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;below search I am using:&lt;/P&gt;

&lt;P&gt;index="application-license" sourcetype=application License_User_device=* License_feature_status="OUT" License_user=*&lt;BR /&gt;
| eval License_feature_status=(License_feature_status) &lt;BR /&gt;
| eval License_User_device=split(License_User_device,",") &lt;BR /&gt;
| eval License_user=split(License_user,",")&lt;BR /&gt;
| makemv delim="," License_user&lt;BR /&gt;
| mvexpand License_user&lt;BR /&gt;
| sort License_user &lt;BR /&gt;
| dedup License_user &lt;BR /&gt;
| stats list(License_user) as "User" list(License_User_device) as "Computer" count(License_feature_status) as "LicenseTaken" by _time&lt;/P&gt;

&lt;P&gt;| outputlookup [ | stats count | eval filename=strftime(now(), "Application-license-usage-per_day_%d.csv") | return $filename]&lt;/P&gt;

&lt;P&gt;...................&lt;/P&gt;

&lt;P&gt;I tried (without results): &lt;/P&gt;

&lt;P&gt;| outputlookup [ | stats count | eval filename=strftime((now()&lt;EM&gt;,"-1d")&lt;/EM&gt;, "Minitab-license-usage-per_day_%d.csv") | return $filename]&lt;BR /&gt;
or&lt;BR /&gt;
| outputlookup [ | stats count | eval filename=relative_time(now(), "-1d@d"), "%m/%d") | return $filename]&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;do you have any idea / solution for me?&lt;/P&gt;

&lt;P&gt;thx in advance&lt;BR /&gt;
Kai&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 04:26:32 GMT</pubDate>
    <dc:creator>knitz</dc:creator>
    <dc:date>2020-09-30T04:26:32Z</dc:date>
    <item>
      <title>return: eval filename=strftime(now(),  with yesterdays count (as fileinformation)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/return-eval-filename-strftime-now-with-yesterdays-count-as/m-p/484746#M135690</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;

&lt;P&gt;looking for some help.&lt;/P&gt;

&lt;P&gt;I am running a search, daily.... but the logs in the source get updated late by the application (the app updates the source/log-file next day with values related to previous day) , so I want to run my search next day and return the result into an outputlookup.csv incl. the day-count of previous day.&lt;/P&gt;

&lt;P&gt;in example: if my search runs daily ... let's say on day 9 (search is on previous day (8 = yesterday) it returns an outputlookup .csv as: file-name_%d.csv which is equal as file-name_09.csv (works perfectly)&lt;/P&gt;

&lt;P&gt;I need to get it returned as: &lt;STRONG&gt;file-name_08.csv&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;below search I am using:&lt;/P&gt;

&lt;P&gt;index="application-license" sourcetype=application License_User_device=* License_feature_status="OUT" License_user=*&lt;BR /&gt;
| eval License_feature_status=(License_feature_status) &lt;BR /&gt;
| eval License_User_device=split(License_User_device,",") &lt;BR /&gt;
| eval License_user=split(License_user,",")&lt;BR /&gt;
| makemv delim="," License_user&lt;BR /&gt;
| mvexpand License_user&lt;BR /&gt;
| sort License_user &lt;BR /&gt;
| dedup License_user &lt;BR /&gt;
| stats list(License_user) as "User" list(License_User_device) as "Computer" count(License_feature_status) as "LicenseTaken" by _time&lt;/P&gt;

&lt;P&gt;| outputlookup [ | stats count | eval filename=strftime(now(), "Application-license-usage-per_day_%d.csv") | return $filename]&lt;/P&gt;

&lt;P&gt;...................&lt;/P&gt;

&lt;P&gt;I tried (without results): &lt;/P&gt;

&lt;P&gt;| outputlookup [ | stats count | eval filename=strftime((now()&lt;EM&gt;,"-1d")&lt;/EM&gt;, "Minitab-license-usage-per_day_%d.csv") | return $filename]&lt;BR /&gt;
or&lt;BR /&gt;
| outputlookup [ | stats count | eval filename=relative_time(now(), "-1d@d"), "%m/%d") | return $filename]&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;do you have any idea / solution for me?&lt;/P&gt;

&lt;P&gt;thx in advance&lt;BR /&gt;
Kai&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:26:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/return-eval-filename-strftime-now-with-yesterdays-count-as/m-p/484746#M135690</guid>
      <dc:creator>knitz</dc:creator>
      <dc:date>2020-09-30T04:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: return: eval filename=strftime(now(),  with yesterdays count (as fileinformation)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/return-eval-filename-strftime-now-with-yesterdays-count-as/m-p/484747#M135691</link>
      <description>&lt;P&gt;You already this question. Please refer to: &lt;A href="https://answers.splunk.com/answers/807806/return-yesterday-count-on-eval-filenamestrftimenow.html"&gt;https://answers.splunk.com/answers/807806/return-yesterday-count-on-eval-filenamestrftimenow.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 15:16:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/return-eval-filename-strftime-now-with-yesterdays-count-as/m-p/484747#M135691</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-02T15:16:36Z</dc:date>
    </item>
  </channel>
</rss>

