<?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: How do I use case and match on a time token to determine proper method for converting time to seconds? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-case-and-match-on-a-time-token-to-determine-proper/m-p/137498#M37681</link>
    <description>&lt;P&gt;"Search is waiting for input." - So the search is not executed yet. &lt;BR /&gt;
If the search was run without results the message would say "Waiting for results" or "No results found".&lt;/P&gt;

&lt;P&gt;Maybe you need to add the attribute searchWhenChanged="true" to the input element or add autoRun="true" to the fieldset element or change the attribute submitButton of the fieldset element from "false" to "true" to execute the search manually.&lt;/P&gt;

&lt;P&gt;Maybe there is something wrong with the latestTime element. The opening and closing angle brackets are escaped in your code.&lt;/P&gt;</description>
    <pubDate>Sat, 06 Jun 2015 17:12:54 GMT</pubDate>
    <dc:creator>kurdbahr</dc:creator>
    <dc:date>2015-06-06T17:12:54Z</dc:date>
    <item>
      <title>How do I use case and match on a time token to determine proper method for converting time to seconds?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-case-and-match-on-a-time-token-to-determine-proper/m-p/137497#M37680</link>
      <description>&lt;P&gt;I have a time input, which I need to use to filter results of a search based on a date field in the search results.  For example, this date could be birthdate for an account of some sort, and I want to filter on the birthdate, rather than the _time, which is when the information is logged.  First, I am parsing out the birthdate with a regular expression, then converting it to seconds since the epoch, so I will have a numeric value I can use to compare.&lt;/P&gt;

&lt;P&gt;With the following, my panel indefinitely shows "Search is waiting for input."  Previously, I was not doing this birthdate comparison, and was simply using &amp;lt;earliestTime&amp;gt; and &amp;lt;latestTime&amp;gt; with the $field1.earliest$ and $field1.latest$ values, respectively.  At this time, I got results, so I know the data is there.&lt;/P&gt;

&lt;P&gt;I know that $field1.earliest$ is initially 0, so I tried removing all cases other than the first one, which is for matching a numeric string.  My expectation was that this would remedy the problem for the initial setting, and I could work on adding the other match cases.  However, the panel continued to display "Search is waiting for input."  &lt;/P&gt;

&lt;P&gt;Included below is the relevant code: first, the time input; followed by the panel with the search string.&lt;BR /&gt;
Thanks for any help!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="time" token="field1"&amp;gt;
      &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
   &amp;lt;panel&amp;gt;
       &amp;lt;table&amp;gt;
          &amp;lt;title&amp;gt;User name&amp;lt;/title&amp;gt;
          &amp;lt;searchString&amp;gt;index=X app=Y "username"| rex field=message "&amp;lt;BirthDatet&amp;gt;(?&amp;lt;BirthDate&amp;gt;.+)&amp;lt;\/BirthDate&amp;gt;"                 | eval birthDateTime = strpTime(BirthDate,"%Y-%m-%d") 
                | eval StartTime = case(match($field1.earliest$,"^\d+\.?\d*$"),$field1.earliest$,
                                        match($field1.earliest$,"^.*([A-Z]|[a-z]).*$"),relative_time(now(),$field1.earliest$),
                                        match($field1.earliest$,"^.+\/.+$"),auto($field1.earliest$),
                                        1=1, 0)
                 | where birthDateTime &amp;gt; StartTime
           &amp;lt;/searchString&amp;gt;
    &amp;lt;earliestTime&amp;gt;0&amp;lt;/earliestTime&amp;gt;
    &amp;amp;lt;latestTime&amp;amp;gt;$field1.latest$&amp;amp;lt;/latestTime&amp;amp;gt;
    &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
    &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
    &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
    &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
    &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
  &amp;lt;/table&amp;gt;
&amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Jun 2015 19:39:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-case-and-match-on-a-time-token-to-determine-proper/m-p/137497#M37680</guid>
      <dc:creator>mboker</dc:creator>
      <dc:date>2015-06-05T19:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use case and match on a time token to determine proper method for converting time to seconds?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-case-and-match-on-a-time-token-to-determine-proper/m-p/137498#M37681</link>
      <description>&lt;P&gt;"Search is waiting for input." - So the search is not executed yet. &lt;BR /&gt;
If the search was run without results the message would say "Waiting for results" or "No results found".&lt;/P&gt;

&lt;P&gt;Maybe you need to add the attribute searchWhenChanged="true" to the input element or add autoRun="true" to the fieldset element or change the attribute submitButton of the fieldset element from "false" to "true" to execute the search manually.&lt;/P&gt;

&lt;P&gt;Maybe there is something wrong with the latestTime element. The opening and closing angle brackets are escaped in your code.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jun 2015 17:12:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-case-and-match-on-a-time-token-to-determine-proper/m-p/137498#M37681</guid>
      <dc:creator>kurdbahr</dc:creator>
      <dc:date>2015-06-06T17:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use case and match on a time token to determine proper method for converting time to seconds?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-case-and-match-on-a-time-token-to-determine-proper/m-p/137499#M37682</link>
      <description>&lt;P&gt;Yea, the latestTime element is only appearing that way in the question.  I even tried to change it to '&amp;lt;' and '&amp;gt;' and it changed back when I saved it.  I will try your suggestions. &lt;BR /&gt;
Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2015 13:15:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-case-and-match-on-a-time-token-to-determine-proper/m-p/137499#M37682</guid>
      <dc:creator>mboker</dc:creator>
      <dc:date>2015-06-08T13:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use case and match on a time token to determine proper method for converting time to seconds?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-case-and-match-on-a-time-token-to-determine-proper/m-p/137500#M37683</link>
      <description>&lt;P&gt;I've tried both suggested solutions, and neither has solved my problem, unfortunately.  &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2015 13:25:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-case-and-match-on-a-time-token-to-determine-proper/m-p/137500#M37683</guid>
      <dc:creator>mboker</dc:creator>
      <dc:date>2015-06-08T13:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use case and match on a time token to determine proper method for converting time to seconds?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-case-and-match-on-a-time-token-to-determine-proper/m-p/137501#M37684</link>
      <description>&lt;P&gt;It's the $ character that's the problem. Try replacing, in your regex, &lt;CODE&gt;$&lt;/CODE&gt; (end of line) with &lt;CODE&gt;\Z&lt;/CODE&gt; (end of string). For example&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"^\d+\.?\d*$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;becomes&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"^\d+\.?\d*\Z"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 20:55:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-case-and-match-on-a-time-token-to-determine-proper/m-p/137501#M37684</guid>
      <dc:creator>sbob909</dc:creator>
      <dc:date>2015-11-04T20:55:59Z</dc:date>
    </item>
  </channel>
</rss>

