<?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 filter Splunk field results by time? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-filter-Splunk-field-results-by-time/m-p/596191#M48884</link>
    <description>&lt;P&gt;I'm currently building a query that will pull data from today to April 26th,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the field value contains the following time format&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;termination_initiated (field value name)
2022-05-02T11:47:01.011-07:00
2022-05-02T11:42:10.820-07:00&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I'm currently trying to convert is so that i can only get results between today and April 26th.&lt;BR /&gt;&lt;BR /&gt;I've tried this piece of code with no luck&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval terminiation_started=strptime(termination_initiated,"%Y-%m-%dT %H:%M:%S.%QZ")
| where termination_started&amp;gt;=relative_time(now(),"-6d@d")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 May 2022 20:12:07 GMT</pubDate>
    <dc:creator>tayvionp</dc:creator>
    <dc:date>2022-05-02T20:12:07Z</dc:date>
    <item>
      <title>How to filter Splunk field results by time?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-filter-Splunk-field-results-by-time/m-p/596191#M48884</link>
      <description>&lt;P&gt;I'm currently building a query that will pull data from today to April 26th,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the field value contains the following time format&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;termination_initiated (field value name)
2022-05-02T11:47:01.011-07:00
2022-05-02T11:42:10.820-07:00&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I'm currently trying to convert is so that i can only get results between today and April 26th.&lt;BR /&gt;&lt;BR /&gt;I've tried this piece of code with no luck&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval terminiation_started=strptime(termination_initiated,"%Y-%m-%dT %H:%M:%S.%QZ")
| where termination_started&amp;gt;=relative_time(now(),"-6d@d")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 20:12:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-filter-Splunk-field-results-by-time/m-p/596191#M48884</guid>
      <dc:creator>tayvionp</dc:creator>
      <dc:date>2022-05-02T20:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter Splunk field results by time?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-filter-Splunk-field-results-by-time/m-p/596192#M48885</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;strptime&lt;/FONT&gt; format string doesn't match the example data.&amp;nbsp; Try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"%Y-%m-%dT%H:%M:%S.%3N%:z"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 20:45:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-filter-Splunk-field-results-by-time/m-p/596192#M48885</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-05-02T20:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter Splunk field results by time?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-filter-Splunk-field-results-by-time/m-p/596210#M48886</link>
      <description>&lt;P&gt;Aside from&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;comment about format issues, if this is the real query&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval terminiation_started=strptime(termination_initiated,"%Y-%m-%dT %H:%M:%S.%QZ")
| where termination_started&amp;gt;=relative_time(now(),"-6d@d")&lt;/LI-CODE&gt;&lt;P&gt;then the name '&lt;STRONG&gt;terminiation_started&lt;/STRONG&gt;' has an extra 'i', so is not the field you are using in the where clause.&lt;/P&gt;&lt;P&gt;Second issue: Is that example a single event containing two values of the field?&lt;/P&gt;&lt;P&gt;If so, then the logic will not work anyway with the changes suggested.&lt;/P&gt;&lt;P&gt;If it's a multivalue field then you would need something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval rt=relative_time(now(),"-6d@d")
| where tonumber(max(mvmap(termination_started, if(termination_started&amp;gt;=rt, 1, 0))))&amp;gt;0&lt;/LI-CODE&gt;&lt;P&gt;Also, is your _time field different to this termination initiation field?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 02:55:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-filter-Splunk-field-results-by-time/m-p/596210#M48886</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-05-03T02:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter Splunk field results by time?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-filter-Splunk-field-results-by-time/m-p/596249#M48892</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;Thanks, the _time value is indeed different from the "termination_started" field. Also, the 2 values are the first 2 results. They aren't multi-value&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 13:05:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-filter-Splunk-field-results-by-time/m-p/596249#M48892</guid>
      <dc:creator>tayvionp</dc:creator>
      <dc:date>2022-05-03T13:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter Splunk field results by time?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-filter-Splunk-field-results-by-time/m-p/596553#M48912</link>
      <description>&lt;P&gt;Thanks this was the needed format&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 15:37:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-filter-Splunk-field-results-by-time/m-p/596553#M48912</guid>
      <dc:creator>tayvionp</dc:creator>
      <dc:date>2022-05-05T15:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter Splunk field results by time?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-filter-Splunk-field-results-by-time/m-p/596568#M48915</link>
      <description>&lt;P&gt;If your problem is resolved, then please click the "Accept as Solution" button to help future readers.&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 16:44:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-filter-Splunk-field-results-by-time/m-p/596568#M48915</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-05-05T16:44:27Z</dc:date>
    </item>
  </channel>
</rss>

