<?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: _time not same as data timestamp in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/time-not-same-as-data-timestamp/m-p/381249#M111528</link>
    <description>&lt;P&gt;Hi @mdmaala,&lt;/P&gt;

&lt;P&gt;Step one is to simplify your problem. Run only one of the four parts of your search and see if the time displayed is the one from _time. Let me know what you get so we can work this out.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
    <pubDate>Sat, 18 May 2019 09:50:25 GMT</pubDate>
    <dc:creator>DavidHourani</dc:creator>
    <dc:date>2019-05-18T09:50:25Z</dc:date>
    <item>
      <title>_time not same as data timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-not-same-as-data-timestamp/m-p/381248#M111527</link>
      <description>&lt;P&gt;hi! I have to create an area chart where it shows the actual and the target part count of the machine. I am using timechart function to display results every hour, but the _time function is displaying a different time. how can I correct this? &lt;/P&gt;

&lt;P&gt;this is my search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|savedsearch rename1
|fields Date_Time Username Green Yellow Red
|rex field=Date_Time "(?P\d{4}\/\d{2}\/\d{2})\s(?P\d{2}\:\d{2}\:\d{2})" 
|sort 0 _time Username Green Yellow Red
|streamstats window=1 current=f list(_time) as prevTime list(Green) as RUN
|stats count(Green) as Green sum(RUN) as Count1 by Date

|appendcols[|savedsearch rename2
|fields Date_Time Username Green Yellow Red
|rex field=Date_Time "(?P\d{4}\/\d{2}\/\d{2})\s(?P\d{2}\:\d{2}\:\d{2})" 
|sort 0 _time Username Green Yellow Red
|streamstats window=1 current=f list(_time) as prevTime list(Green) as RUN2
|stats count(Green) as Green sum(RUN2) as Count2 by Date]

|appendcols[|savedsearch rename3
|fields Date_Time Username Green Yellow Red
|rex field=Date_Time "(?P\d{4}\/\d{2}\/\d{2})\s(?P\d{2}\:\d{2}\:\d{2})" 
|sort 0 _time Username Green Yellow Red
|streamstats window=1 current=f list(_time) as prevTime list(Green) as RUN3
|stats count(Green) as Green sum(RUN3) as Count3 by Date]

|appendcols[|savedsearch rename4
|fields Date_Time Username Green Yellow Red
|rex field=Date_Time "(?P\d{4}\/\d{2}\/\d{2})\s(?P\d{2}\:\d{2}\:\d{2})" 
|sort 0 _time Username Green Yellow Red
|streamstats window=1 current=f list(_time) as prevTime list(Green) as RUN4
|stats count(Green) as Green sum(RUN4) as Count4 by Date]

|eval PC = Count1+Count2+Count3+Count4
|accum PC
|eval Green = PC*3
|accum Green

|stats values(Green) as Target values(PC) as Actual  by Date
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;here is the screenshot of my chart&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="![![![![![![alt text][1]][1]][1]][1]][1]][1]"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7089i8096A84A9935CF36/image-size/large?v=v2&amp;amp;px=999" role="button" title="![![![![![![alt text][1]][1]][1]][1]][1]][1]" alt="![![![![![![alt text][1]][1]][1]][1]][1]][1]" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 18 May 2019 01:11:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-not-same-as-data-timestamp/m-p/381248#M111527</guid>
      <dc:creator>mdmaala</dc:creator>
      <dc:date>2019-05-18T01:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: _time not same as data timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-not-same-as-data-timestamp/m-p/381249#M111528</link>
      <description>&lt;P&gt;Hi @mdmaala,&lt;/P&gt;

&lt;P&gt;Step one is to simplify your problem. Run only one of the four parts of your search and see if the time displayed is the one from _time. Let me know what you get so we can work this out.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Sat, 18 May 2019 09:50:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-not-same-as-data-timestamp/m-p/381249#M111528</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-18T09:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: _time not same as data timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-not-same-as-data-timestamp/m-p/381250#M111529</link>
      <description>&lt;P&gt;You say you're using the &lt;CODE&gt;timechart&lt;/CODE&gt; function, but I don't see "timechart" anywhere in your query.  Please clarify.&lt;/P&gt;</description>
      <pubDate>Sat, 18 May 2019 12:43:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-not-same-as-data-timestamp/m-p/381250#M111529</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-05-18T12:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: _time not same as data timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-not-same-as-data-timestamp/m-p/381251#M111530</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| savedsearch rename1
| fields Date_Time Username Green Yellow Red
| sort 0 _time Username Green Yellow Red
| streamstats window=1 current=f list(_time) AS prevTime list(Green) AS RUN
| eval _time = strptime(Date_Time, "%Y/%m/%d %H:%M:%S")
| bin _time span=1h
| stats count(Green) AS Green sum(RUN) AS Count1 BY _time

| appendcols[|savedsearch rename2
| fields Date_Time Username Green Yellow Red
| sort 0 _time Username Green Yellow Red
| streamstats window=1 current=f list(_time) AS prevTime list(Green) AS RUN2
| eval _time = strptime(Date_Time, "%Y/%m/%d %H:%M:%S")
| bin _time span=1h
| stats count(Green) AS Green sum(RUN2) AS Count2 BY _time]

| appendcols[|savedsearch rename3
| fields Date_Time Username Green Yellow Red
| sort 0 _time Username Green Yellow Red
| streamstats window=1 current=f list(_time) AS prevTime list(Green) AS RUN3
| eval _time = strptime(Date_Time, "%Y/%m/%d %H:%M:%S")
| bin _time span=1h
| stats count(Green) AS Green sum(RUN3) AS Count3 BY _time]

| appendcols[|savedsearch rename4
| fields Date_Time Username Green Yellow Red
| sort 0 _time Username Green Yellow Red
| streamstats window=1 current=f list(_time) AS prevTime list(Green) AS RUN4
| eval _time = strptime(Date_Time, "%Y/%m/%d %H:%M:%S")
| bin _time span=1h
| stats count(Green) AS Green sum(RUN4) AS Count4 BY _time]

| eval PC = Count1+Count2+Count3+Count4

| accum PC
| eval Green = PC*3
| accum Green

| timechart span=1h values(Green) AS Target values(PC) AS Actual
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You probably should move the &lt;CODE&gt;strptime&lt;/CODE&gt; line farther up (but I did not do that because it will change your data).&lt;/P&gt;</description>
      <pubDate>Sat, 18 May 2019 16:32:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-not-same-as-data-timestamp/m-p/381251#M111530</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-05-18T16:32:45Z</dc:date>
    </item>
  </channel>
</rss>

