<?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: meaning of match(&amp;quot;-24h@h&amp;quot;,&amp;quot;^\d&amp;quot;) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454493#M128588</link>
    <description>&lt;P&gt;The search is obviously part of a drilldown because nobody in his right mind would create &lt;CODE&gt;| eval earliestQual=match("-24h@h","^\d")&lt;/CODE&gt; so it probably started out as something like &lt;CODE&gt;| eval earliestQual=match($field_selector_value$,"^\d")&lt;/CODE&gt;, which totally could happen and makes sense.  Now, back to your question, &lt;CODE&gt;what is it doing?&lt;/CODE&gt;.  It is checking to see if the string that is being tested (in this case &lt;CODE&gt;-24@h&lt;/CODE&gt;) begins with a digit (which in this case, it does not).  Now, &lt;CODE&gt;why is it doing that?&lt;/CODE&gt;.  Who knows.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Feb 2019 17:33:22 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-02-08T17:33:22Z</dc:date>
    <item>
      <title>meaning of match("-24h@h","^\d")</title>
      <link>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454483#M128578</link>
      <description>&lt;P&gt;Hello &lt;BR /&gt;
I have a query that create a field with a value i can't fully understand : &lt;BR /&gt;
eval earliestQual=match("-24h@h","^\d") . &lt;/P&gt;

&lt;P&gt;I understand that the result is the last day, but i don't understand the meaning of  the expression "-24h@h" . It is not a field, so what is it, and where does it gets its value . &lt;/P&gt;

&lt;P&gt;Thanks !!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 11:29:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454483#M128578</guid>
      <dc:creator>astatrial</dc:creator>
      <dc:date>2019-02-06T11:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: meaning of match("-24h@h","^\d")</title>
      <link>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454484#M128579</link>
      <description>&lt;P&gt;Hello @astatrial &lt;/P&gt;

&lt;P&gt;The above command is matching two values and the result will always be False. As there are one string and one regex need to compared. so it is just matching the value based on regex. And the regex need only first character as a digit, which is not the case with "-24h@h". &lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 11:52:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454484#M128579</guid>
      <dc:creator>vishaltaneja070</dc:creator>
      <dc:date>2019-02-06T11:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: meaning of match("-24h@h","^\d")</title>
      <link>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454485#M128580</link>
      <description>&lt;P&gt;In normal cases like where you mention earliest=-24h@h, in that case it the time range will go back to last 24 hours and snap the hour field.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 11:53:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454485#M128580</guid>
      <dc:creator>vishaltaneja070</dc:creator>
      <dc:date>2019-02-06T11:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: meaning of match("-24h@h","^\d")</title>
      <link>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454486#M128581</link>
      <description>&lt;P&gt;@astatrial ,&lt;/P&gt;

&lt;P&gt;It doesn't seem to be a complete eval expression because:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Match returns a boolean and can not be assigned to a field.&lt;/LI&gt;
&lt;LI&gt;-24h@h should be relative to a "time" - either current time (now()) or any other time field in epoch format.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Nevertheless, the meaning of this extract is &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;subsract 24hrs from the "time" and snap to the nearest hour. ( i.e. if the time is 06-Feb-2019 07:20 then -24h@h will result 05-Feb-2019 07:00)&lt;/LI&gt;
&lt;LI&gt;Check whether the resulted time starts with a digit  (not sure about the logic behind this check without knowing the full context)&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 06 Feb 2019 11:58:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454486#M128581</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-02-06T11:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: meaning of match("-24h@h","^\d")</title>
      <link>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454487#M128582</link>
      <description>&lt;P&gt;you are right. &lt;BR /&gt;
It is not the complete eval expression. &lt;BR /&gt;
The complete eval expression is : &lt;/P&gt;

&lt;P&gt;| eval earliestQual=case(match("-24h@h", "^\d"), tostring("-24h@h"), match("-24h@h", "^([@+-]){1}"), relative_time(time(), "-24h@h"), true(), time()) &lt;/P&gt;

&lt;P&gt;I just didn't want to confuse you with non relevant info. &lt;/P&gt;

&lt;P&gt;The second clause in your answer is exactly my question - This expression isn't relative to any time, so how it is getting its value ? &lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 12:44:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454487#M128582</guid>
      <dc:creator>astatrial</dc:creator>
      <dc:date>2019-02-06T12:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: meaning of match("-24h@h","^\d")</title>
      <link>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454488#M128583</link>
      <description>&lt;P&gt;@astatrial , &lt;BR /&gt;
In a plain text search , it does not make much sense. However , I strongly believe that its part of a dashboard with a time input in it. In that case, &lt;CODE&gt;-24h@h&lt;/CODE&gt; is not a string value in the search but a token in the form &lt;CODE&gt;$some_token$&lt;/CODE&gt; which carries value from the time input and this eval statement tries to find out what the user has opted from the time input&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 13:11:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454488#M128583</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-02-06T13:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: meaning of match("-24h@h","^\d")</title>
      <link>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454489#M128584</link>
      <description>&lt;P&gt;This code indeed looks familiar for a dashboard I've worked on once. I used &lt;CODE&gt;eval&lt;/CODE&gt; in the change event of a time input in a case where I always needed an epoch value from the input, regardless of the actual selection (a time picker will return something like &lt;CODE&gt;-1w&lt;/CODE&gt; for earliest if you select last week). It looked something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;change&amp;gt;
  &amp;lt;eval token="time_earliest_alwaysepoch"&amp;gt;case(match($value$, "^\d+"), $value$, match($value$, "[+-]\d+@?"), relative_time(now(), $value$)&amp;lt;/eval&amp;gt;
&amp;lt;/change&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This was to make sure I always had an epoch value in that token, and it led me to &lt;A href="https://answers.splunk.com/answers/145346/convert-timerange-to-epoch-values.html"&gt;this&lt;/A&gt; discussion. I doubt your code makes sense, as @renjith.nair already pointed out in his comment.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 13:25:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454489#M128584</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2019-02-06T13:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: meaning of match("-24h@h","^\d")</title>
      <link>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454490#M128585</link>
      <description>&lt;P&gt;This eval is part of the "Endpoint - Anomalous New Processes" correlation search. There is no use of token in it. &lt;/P&gt;

&lt;P&gt;|from inputlookup:"localprocesses_tracker" | eval earliestQual=case(match("-24h@h", "^\d"), tostring("-24h@h"),  match("-24h@h", "^([@+-]){1}"), relative_time(time(), "-24h@h"),  true(), time()) | eval latestQual=case(match("+0s", "^\d"), tostring("+0s"),  match("+0s", "^([@+-]){1}"), relative_time(time(), "+0s"),  true(), time()) | where ('firstTime'&amp;gt;=earliestQual AND 'firstTime'&amp;lt;=latestQual) | fields - earliestQual, latestQual | stats dc(dest) as "dest_count",values(dest) as "dest" by "process" | where 'dest_count'&amp;gt;9&lt;/P&gt;

&lt;P&gt;What i thought is that this eval calculate a time value of the last 24 hours in specific pattern depending on how the time is represented (i.e in the time picker). But i didn't understand how the expression -24h@h knows to get this value. &lt;BR /&gt;
Is it some kind of known phrase in splunk?&lt;/P&gt;

&lt;P&gt;I really appreciate your help ! |&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:10:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454490#M128585</guid>
      <dc:creator>astatrial</dc:creator>
      <dc:date>2020-09-29T23:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: meaning of match("-24h@h","^\d")</title>
      <link>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454491#M128586</link>
      <description>&lt;P&gt;@renjith.nair&lt;BR /&gt;
For some reason i couldn't comment to you in your answer. &lt;/P&gt;

&lt;P&gt;This  eval is part of the correlation search - "Endpoint - Anomalous New Processes" : &lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
|from inputlookup:"localprocesses_tracker" | eval earliestQual=case(match("-24h@h", "^\d"), tostring("-24h@h"),  match("-24h@h", "^([@+-]){1}"), relative_time(time(), "-24h@h"),  true(), time()) | eval latestQual=case(match("+0s", "^\d"), tostring("+0s"),  match("+0s", "^([@+-]){1}"), relative_time(time(), "+0s"),  true(), time()) | where ('firstTime'&amp;gt;=earliestQual AND 'firstTime'&amp;lt;=latestQual) | fields - earliestQual, latestQual | stats dc(dest) as "dest_count",values(dest) as "dest" by "process" | where 'dest_count'&amp;gt;9&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;What i thought is that this eval calculates a time value of the last 24 hours depending on how the source time is represented. &lt;BR /&gt;
I just didn't understand how the &lt;CODE&gt;-24h@h&lt;/CODE&gt; knows which time source to refer.&lt;/P&gt;

&lt;P&gt;I appreciate your help!!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:05:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454491#M128586</guid>
      <dc:creator>astatrial</dc:creator>
      <dc:date>2020-09-29T23:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: meaning of match("-24h@h","^\d")</title>
      <link>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454492#M128587</link>
      <description>&lt;P&gt;@astatrial ,&lt;BR /&gt;
If its part of Enterprise Security, it might be part of the &lt;CODE&gt;macros&lt;/CODE&gt;.  localprocesses_tracker has mainly information about the process history (dest,firstime,lasttime,process) . So most probably whatever you are seeing is an &lt;CODE&gt;expanded&lt;/CODE&gt; search with values substituted.  &lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 15:35:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454492#M128587</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-02-06T15:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: meaning of match("-24h@h","^\d")</title>
      <link>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454493#M128588</link>
      <description>&lt;P&gt;The search is obviously part of a drilldown because nobody in his right mind would create &lt;CODE&gt;| eval earliestQual=match("-24h@h","^\d")&lt;/CODE&gt; so it probably started out as something like &lt;CODE&gt;| eval earliestQual=match($field_selector_value$,"^\d")&lt;/CODE&gt;, which totally could happen and makes sense.  Now, back to your question, &lt;CODE&gt;what is it doing?&lt;/CODE&gt;.  It is checking to see if the string that is being tested (in this case &lt;CODE&gt;-24@h&lt;/CODE&gt;) begins with a digit (which in this case, it does not).  Now, &lt;CODE&gt;why is it doing that?&lt;/CODE&gt;.  Who knows.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 17:33:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/meaning-of-match-quot-24h-h-quot-quot-d-quot/m-p/454493#M128588</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-08T17:33:22Z</dc:date>
    </item>
  </channel>
</rss>

