<?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: To pick dynamic Date value and add as filter in query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-pick-dynamic-date-value-and-add-as-filter-in-query/m-p/643572#M222934</link>
    <description>&lt;P&gt;hey, thanks for your response.&lt;/P&gt;&lt;P&gt;So this sourcetype scrapes data from our AWS console. AWS console displays data for last 10 days and this data is pused to splunk as is.&amp;nbsp;&lt;BR /&gt;When i make use of this source i get details of all resources that were present for past 10 days along with its creation date. I dont want anything except yesterdays date and if i want to manually load up and put 2023-05-17 i will only get results of that particular day because date is also part of the log thats getting pushed.&lt;BR /&gt;&lt;BR /&gt;Now i have to automate it and i need dynamic value to be printed as a search filter like mentioned above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Siri&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 May 2023 07:35:15 GMT</pubDate>
    <dc:creator>Siri9996</dc:creator>
    <dc:date>2023-05-17T07:35:15Z</dc:date>
    <item>
      <title>How to pick dynamic date value and add as filter in query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pick-dynamic-date-value-and-add-as-filter-in-query/m-p/643542#M222925</link>
      <description>&lt;P&gt;HI Team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am posting only part of the query to avoid confusion. the sourcetype logs data for past 10 days everyday I search for it because thats how its designed and I am fine with it. However, I want to filter only for yesterdays date for another purpose and want to use the same source. If I simply put 2023-05-16 as a filter in my search query I can get the data but&amp;nbsp; I want to automate it to fetch results everyday and every day I run, it should by default take yesterdays value.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I simple want to print the value of result.yesterday in my search query like how i can mention 2023-05-16. Could you please let me know how I can achieve this?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;| makeresults | eval yesterday = strftime(relative_time(now(), "-1d@d"), "%Y-%m-%d")|fields - relative_time&lt;BR /&gt;$result.yesterday$&lt;BR /&gt;search index=infra source=*emr* sourcetype="aws:description" source="*emr_clusters" account_id="a0087"&lt;BR /&gt;| dedup Id&lt;BR /&gt;| rename Name as cluster_name,&lt;BR /&gt;Id as JobFlowId&lt;BR /&gt;Status.Timeline.CreationDateTime as cluster_creation_on,&lt;BR /&gt;Status.Timeline.ReadyDateTime as cluster_ready_on,&lt;BR /&gt;Status.Timeline.EndDateTime as cluster_terminate_on&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 11:47:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pick-dynamic-date-value-and-add-as-filter-in-query/m-p/643542#M222925</guid>
      <dc:creator>Siri9996</dc:creator>
      <dc:date>2023-05-17T11:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: To pick dynamic Date value and add as filter in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pick-dynamic-date-value-and-add-as-filter-in-query/m-p/643546#M222927</link>
      <description>&lt;P class="lia-align-center"&gt;OR&lt;/P&gt;&lt;P class="lia-align-left"&gt;I tried another way. When i created dashboard and called the $date$ value in my query it worked. So,&amp;nbsp; I changed it to report and called the field in the query that is part of&amp;nbsp;ref="EMR-test report".&amp;nbsp; I just added $date$ in the query that is part of report. But somehow its not picking. please let me know if I am missing anything here.&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;lt;form version="1.1"&amp;gt;&lt;BR /&gt;&amp;lt;search&amp;gt;&lt;BR /&gt;&amp;lt;query&amp;gt;| makeresults| eval today = strftime(relative_time(now(), "-1d@d"), "%Y-%m-%d")|fields - relative_time&amp;lt;/query&amp;gt;&lt;BR /&gt;&amp;lt;done&amp;gt;&lt;BR /&gt;&amp;lt;set token="defaut_time"&amp;gt;$result.today$&amp;lt;/set&amp;gt;&lt;BR /&gt;&amp;lt;/done&amp;gt;&lt;BR /&gt;&amp;lt;/search&amp;gt;&lt;BR /&gt;&amp;lt;fieldset submitButton="false" autoRun="true"&amp;gt;&lt;BR /&gt;&amp;lt;input type="text" token="date"&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;date&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;default&amp;gt;$defaut_time$&amp;lt;/default&amp;gt;&lt;BR /&gt;&amp;lt;/input&amp;gt;&lt;BR /&gt;&amp;lt;/fieldset&amp;gt;&lt;BR /&gt;&amp;lt;row&amp;gt;&lt;BR /&gt;&amp;lt;panel&amp;gt;&lt;BR /&gt;&amp;lt;table&amp;gt;&lt;BR /&gt;&amp;lt;search ref="EMR-test report"&amp;gt;&amp;lt;/search&amp;gt;&lt;BR /&gt;&amp;lt;option name="count"&amp;gt;100&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;/table&amp;gt;&lt;BR /&gt;&amp;lt;/panel&amp;gt;&lt;BR /&gt;&amp;lt;/row&amp;gt;&lt;BR /&gt;&amp;lt;/form&amp;gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 04:46:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pick-dynamic-date-value-and-add-as-filter-in-query/m-p/643546#M222927</guid>
      <dc:creator>Siri9996</dc:creator>
      <dc:date>2023-05-17T04:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: To pick dynamic Date value and add as filter in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pick-dynamic-date-value-and-add-as-filter-in-query/m-p/643551#M222928</link>
      <description>&lt;P&gt;A little confusing. &amp;nbsp;What's preventing you from using simple search terms like this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; index=infra source=*emr* sourcetype="aws:description" source="*emr_clusters" account_id="a0087" earliest=-1d@d latest=-0d@d
| dedup Id
| rename Name as cluster_name,
Id as JobFlowId
Status.Timeline.CreationDateTime as cluster_creation_on,
Status.Timeline.ReadyDateTime as cluster_ready_on,
Status.Timeline.EndDateTime as cluster_terminate_on&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 04:53:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pick-dynamic-date-value-and-add-as-filter-in-query/m-p/643551#M222928</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-05-17T04:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: To pick dynamic Date value and add as filter in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pick-dynamic-date-value-and-add-as-filter-in-query/m-p/643572#M222934</link>
      <description>&lt;P&gt;hey, thanks for your response.&lt;/P&gt;&lt;P&gt;So this sourcetype scrapes data from our AWS console. AWS console displays data for last 10 days and this data is pused to splunk as is.&amp;nbsp;&lt;BR /&gt;When i make use of this source i get details of all resources that were present for past 10 days along with its creation date. I dont want anything except yesterdays date and if i want to manually load up and put 2023-05-17 i will only get results of that particular day because date is also part of the log thats getting pushed.&lt;BR /&gt;&lt;BR /&gt;Now i have to automate it and i need dynamic value to be printed as a search filter like mentioned above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Siri&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 07:35:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pick-dynamic-date-value-and-add-as-filter-in-query/m-p/643572#M222934</guid>
      <dc:creator>Siri9996</dc:creator>
      <dc:date>2023-05-17T07:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: To pick dynamic Date value and add as filter in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pick-dynamic-date-value-and-add-as-filter-in-query/m-p/643707#M222992</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Any leads will be of great help&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 00:30:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pick-dynamic-date-value-and-add-as-filter-in-query/m-p/643707#M222992</guid>
      <dc:creator>Siri9996</dc:creator>
      <dc:date>2023-05-18T00:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: To pick dynamic Date value and add as filter in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pick-dynamic-date-value-and-add-as-filter-in-query/m-p/643709#M222993</link>
      <description>&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Hope I am clear.&amp;nbsp; Any leads would be of great help here.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have mentioned about the other way I tried. I am fine with either ways if its working.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 18 May 2023 00:34:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pick-dynamic-date-value-and-add-as-filter-in-query/m-p/643709#M222993</guid>
      <dc:creator>Siri9996</dc:creator>
      <dc:date>2023-05-18T00:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: To pick dynamic Date value and add as filter in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pick-dynamic-date-value-and-add-as-filter-in-query/m-p/643722#M222999</link>
      <description>&lt;P&gt;First to clarify. &amp;nbsp;AWS console gives you 10-days' worth of data every day. &amp;nbsp;I get that. &amp;nbsp;Is this set of data in individual events, e.g., one event for&amp;nbsp;&lt;SPAN&gt;2023-05-17, another for&amp;nbsp;2023-05-16, and so on? &amp;nbsp;Or are all 10 days in one event? &amp;nbsp;Based on your original description, it is the former. &amp;nbsp;Correct?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If each event only contains data for one particular time, not all 10 days' worth, the best solution is to change ingestion to use that time as event time, i.e., _time. &amp;nbsp;Is there some reason to not do that?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If that is not possible, the next best thing is to look for a field that is already extracted that contains this timestamp. &amp;nbsp;Is there such a field in your raw event?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If by default, Splunk has not extracted this value into a field, the next best thing would be to add your own automatic extraction.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 03:06:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pick-dynamic-date-value-and-add-as-filter-in-query/m-p/643722#M222999</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-05-18T03:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: To pick dynamic Date value and add as filter in query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pick-dynamic-date-value-and-add-as-filter-in-query/m-p/643755#M223012</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Missed this reply of yours. Thanks a lot. i have extracted the field and gave the value that i want.&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 10:59:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pick-dynamic-date-value-and-add-as-filter-in-query/m-p/643755#M223012</guid>
      <dc:creator>Siri9996</dc:creator>
      <dc:date>2023-05-18T10:59:45Z</dc:date>
    </item>
  </channel>
</rss>

