<?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: confusion with @ symbol in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474074#M192435</link>
    <description>&lt;P&gt;@gcusello we will go step by step, please be patient with me.&lt;BR /&gt;
-h@h means? is it a previous hour?&lt;BR /&gt;
for example, my current time is 4:56 what would -h@h constitute to?&lt;/P&gt;

&lt;P&gt;a week ago @vnravikumar helped me understand -d@d means yesterday, -100d@d is like previous 100 days from today.&lt;/P&gt;

&lt;P&gt;I am still stuck with time though.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jan 2020 11:29:00 GMT</pubDate>
    <dc:creator>palisetty</dc:creator>
    <dc:date>2020-01-02T11:29:00Z</dc:date>
    <item>
      <title>confusion with @ symbol</title>
      <link>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474071#M192432</link>
      <description>&lt;P&gt;I know that '@' rounds off to the nearest time. For example, if we have 9:37, shouldn't it round off to 10 instead of 9?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 11:07:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474071#M192432</guid>
      <dc:creator>palisetty</dc:creator>
      <dc:date>2020-01-02T11:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: confusion with @ symbol</title>
      <link>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474072#M192433</link>
      <description>&lt;P&gt;Hi @palisetty,&lt;BR /&gt;
@ seems that you around the time period to the unit you add after @:&lt;BR /&gt;
in other words, -h@h seems the full hout from 00 minute to 59 minute, -h@m arount to the full minute, so at 9.37 seems from 8.37.00.&lt;/P&gt;

&lt;P&gt;In your example if you want to take logs at 9.37 from 8.00 to 9.00 you can use &lt;CODE&gt;earliest=-h@h latest=@h&lt;/CODE&gt;.&lt;BR /&gt;
At 9.37 you cannot round to 10.00 because it's a future time.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 11:19:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474072#M192433</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-01-02T11:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: confusion with @ symbol</title>
      <link>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474073#M192434</link>
      <description>&lt;P&gt;have a look &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.1/SearchReference/MathematicalFunctions"&gt;here&lt;/A&gt;, splunk has round, ceil, floor functions that you can use along with eval command to perform rounding.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eg:   ...| eval n=ceil(1.9)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;returns n=2&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 11:21:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474073#M192434</guid>
      <dc:creator>soumyasaha25</dc:creator>
      <dc:date>2020-01-02T11:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: confusion with @ symbol</title>
      <link>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474074#M192435</link>
      <description>&lt;P&gt;@gcusello we will go step by step, please be patient with me.&lt;BR /&gt;
-h@h means? is it a previous hour?&lt;BR /&gt;
for example, my current time is 4:56 what would -h@h constitute to?&lt;/P&gt;

&lt;P&gt;a week ago @vnravikumar helped me understand -d@d means yesterday, -100d@d is like previous 100 days from today.&lt;/P&gt;

&lt;P&gt;I am still stuck with time though.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 11:29:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474074#M192435</guid>
      <dc:creator>palisetty</dc:creator>
      <dc:date>2020-01-02T11:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: confusion with @ symbol</title>
      <link>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474075#M192436</link>
      <description>&lt;P&gt;Hi @palisetty,&lt;BR /&gt;
No problem, ask what you need and take your times!&lt;BR /&gt;
So &lt;CODE&gt;-h@h&lt;/CODE&gt; is the past hour (from 0 to 59 minutes), &lt;CODE&gt;@h&lt;/CODE&gt; is the start of the present hour.&lt;BR /&gt;
In your example if you want to take logs at 9.37 from 8.00 to 8.59 you can use &lt;CODE&gt;earliest=-h@h latest=@h&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 11:34:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474075#M192436</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-01-02T11:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: confusion with @ symbol</title>
      <link>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474076#M192437</link>
      <description>&lt;P&gt;@gcusello So, you are saying, for the example of 9:37, if I say &lt;A href="mailto:-h@h"&gt;-h@h&lt;/A&gt;. @h will be 9 and -h will be from 8:00 to 8:59.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 12:06:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474076#M192437</guid>
      <dc:creator>palisetty</dc:creator>
      <dc:date>2020-01-02T12:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: confusion with @ symbol</title>
      <link>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474077#M192438</link>
      <description>&lt;P&gt;Thank You @soumyasaha25 I am not up to your level, I am just preparing for Fundamental 1 exam.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 12:07:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474077#M192438</guid>
      <dc:creator>palisetty</dc:creator>
      <dc:date>2020-01-02T12:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: confusion with @ symbol</title>
      <link>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474078#M192439</link>
      <description>&lt;P&gt;Hi @palisetty,&lt;BR /&gt;
As I said: -h@h is the past hour (at 9.39 it means 8.00), @h is the start of the present hour (at 9.39 it means 9.00).&lt;BR /&gt;
Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 12:10:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474078#M192439</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-01-02T12:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: confusion with @ symbol</title>
      <link>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474079#M192440</link>
      <description>&lt;P&gt;Perfect. Thank you. @gcusello you are one of the best mentors&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 12:14:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474079#M192440</guid>
      <dc:creator>palisetty</dc:creator>
      <dc:date>2020-01-02T12:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: confusion with @ symbol</title>
      <link>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474080#M192441</link>
      <description>&lt;P&gt;@palisetty  again I will recommend you to read about Time Modifiers and snap to time in the Splunk Documentation: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/SearchTimeModifiers#Specify_a_snap_to_time_unit"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/SearchTimeModifiers#Specify_a_snap_to_time_unit&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;One of the easiest place to try out an learn about (1) Time Modifiers (2) snap to time and (3) offset is the &lt;CODE&gt;Advance&lt;/CODE&gt; dialog option within the Time Range Picker provided in the Splunk UI.&lt;/P&gt;

&lt;P&gt;For example if current date is &lt;CODE&gt;01/02/2020&lt;/CODE&gt;, then &lt;CODE&gt;-1d@d&lt;/CODE&gt; resolves to &lt;CODE&gt;01/01/2020 12:00:00.000 AM&lt;/CODE&gt;. You can always split this and read as &lt;CODE&gt;minus one day&lt;/CODE&gt; ( i.e. for &lt;CODE&gt;-1d&lt;/CODE&gt; ) &lt;CODE&gt;and snap-to the beginning of the day&lt;/CODE&gt; (i.e. for &lt;CODE&gt;@d&lt;/CODE&gt; ).&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8140iD93872811BAACEB5/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;To further add the concept of offset, you can make the next level of adjustment by adding/subtracting offset to this time.&lt;/P&gt;

&lt;P&gt;For example &lt;CODE&gt;-0d@d-1s&lt;/CODE&gt; or simply &lt;CODE&gt;@d-1s&lt;/CODE&gt; will &lt;CODE&gt;snap to the beginning of the day yesterday but also subtract 1 second ensuring instead of 12:00 AM for today it will be 11:59:59 for yesterday&lt;/CODE&gt; i.e. &lt;CODE&gt;01/01/2020 11:59:59.000&lt;/CODE&gt; where as &lt;CODE&gt;-0d@d&lt;/CODE&gt; is &lt;CODE&gt;01/02/2019 12:00:00.000&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Hope the above makes sense. Do try out the time modifiers in the Time Range input in Splunk to understand and practice the concept.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;You can also try out the following run anywhere example&lt;/STRONG&gt; where you need to add the Time Modifier to using &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/DateandTimeFunctions#relative_time.28X.2CY.29"&gt;relative_time()&lt;/A&gt; evaluation function to generate EPOCH time which is converted to string time of format &lt;CODE&gt;YYYY-MM-DD HH:MM:SS&lt;/CODE&gt; using &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Fieldformat"&gt;fieldformat&lt;/A&gt; command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| fields - _time
| eval Time=relative_time(now(),"-1d@d")
| fieldformat Time=strftime(Time,"%Y/%m/%d %H:%M:%S")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If today is &lt;CODE&gt;01/02/2020&lt;/CODE&gt; then following is the output of "-1d@d" in &lt;CODE&gt;relative_time()&lt;/CODE&gt; function:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Time
2020/01/01 00:00:00
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Jan 2020 18:25:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474080#M192441</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-01-02T18:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: confusion with @ symbol</title>
      <link>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474081#M192442</link>
      <description>&lt;P&gt;@soumyasaha25 I think you missed the question, query was for snapping the time modifier. What you have provided is evaluation &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/MathematicalFunctions#ceiling.28X.29_or_ceil.28X.29"&gt;ceiling()&lt;/A&gt; function for numeric fields not Splunk Time format.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 18:26:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474081#M192442</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-01-02T18:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: confusion with @ symbol</title>
      <link>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474082#M192443</link>
      <description>&lt;P&gt;@gcusello for snapping to &lt;CODE&gt;8:59&lt;/CODE&gt; the correct time modifier will have snap-to as well as offset i.e.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;@h-1s&lt;/CODE&gt; which snaps to &lt;CODE&gt;08:59:59&lt;/CODE&gt;, just &lt;CODE&gt;@h&lt;/CODE&gt; will snap to &lt;CODE&gt;09:00:00&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 18:30:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474082#M192443</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-01-02T18:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: confusion with @ symbol</title>
      <link>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474083#M192444</link>
      <description>&lt;P&gt;Hi @palisetty,&lt;BR /&gt;
As I said at 9.37 from 8.00 to 8.59 you can use &lt;CODE&gt;earliest=-h@h latest=@h&lt;/CODE&gt;, because you use &lt;CODE&gt;-h@h&lt;/CODE&gt; and &lt;CODE&gt;@h&lt;/CODE&gt; for earliest and latest so you can fix the time period in this way, you don't need to use &lt;CODE&gt;@h-1s&lt;/CODE&gt; for latest.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 22:51:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/confusion-with-symbol/m-p/474083#M192444</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-01-02T22:51:18Z</dc:date>
    </item>
  </channel>
</rss>

