<?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 to add time to an event in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/How-to-add-time-to-an-event/m-p/542676#M8826</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/226742"&gt;@Mary666&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have a few options, but the two simplest ones are:&lt;/P&gt;&lt;P&gt;To convert the field back to a string:&lt;/P&gt;&lt;P&gt;| eval&amp;nbsp;&lt;SPAN&gt;Scheduled_Ingestion_Time=strftime(strptime(latestArchive, "%Y-%m-%d %H:%M:%S.%3N") + 4500, "&lt;SPAN&gt;%Y-%m-%d %H:%M:%S.%3N")&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;To leave the field an integer but display it as a string:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| eval&amp;nbsp;Scheduled_Ingestion_Time=strptime(latestArchive, "%Y-%m-%d %H:%M:%S.%3N") + 4500&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| fieldformat&amp;nbsp;&lt;SPAN&gt;Scheduled_Ingestion_Time=strftime(Scheduled_Ingestion_Time, "%Y-%m-%d %H:%M:%S.%3N")&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The time function names can be read as "string from time" and "string parse time."&lt;/P&gt;</description>
    <pubDate>Sat, 06 Mar 2021 03:08:23 GMT</pubDate>
    <dc:creator>tscroggins</dc:creator>
    <dc:date>2021-03-06T03:08:23Z</dc:date>
    <item>
      <title>How to add time to an event</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-add-time-to-an-event/m-p/542664#M8823</link>
      <description>&lt;P&gt;Hello Splunk Community,&lt;/P&gt;&lt;P&gt;I have read through the Q&amp;amp;A 7 pages in and read through several instructions on how to do this, but still cant seem to find what I need to do. I am trying to add 1 hr and 15 min to the event latestEvent. Can obtain some guidance on how to add 1 hr and 15 min to a field? In this case the filed is latestEvent.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index="xyz" event=submission ) OR (index="abc )
| eval latestEvent=case(event="submission", timeofsub)
| eval Scheduled_Ingestion_Time=relative_time(latestEvent, "+3615")
| stats  latest(latestEvent) as latestEvent values(Scheduled_Ingestion_Time) as Scheduled_Ingestion_Time  &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Mar 2021 00:25:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-add-time-to-an-event/m-p/542664#M8823</guid>
      <dc:creator>Mary666</dc:creator>
      <dc:date>2021-03-06T00:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to add time to an event</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-add-time-to-an-event/m-p/542666#M8824</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/226742"&gt;@Mary666&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Timestamp fields like _time are integer Unix epoch values: the number of seconds elapsed since January 1, 1970 12:00 AM.&lt;/P&gt;&lt;P&gt;To add 1 hr and 15 min to a time field, add 4500 seconds:&lt;/P&gt;&lt;P&gt;| eval Scheduled_Ingestion_Time=latestEvent + 4500&lt;/P&gt;&lt;P&gt;If latestEvent isn't a time field, you'll need to convert it to one using whatever method is appropriate for your data. For example, if latestEvent is the string "2021-03-05 00:00:00" you would use:&lt;/P&gt;&lt;P&gt;| eval Scheduled_Ingestion_Time=strptime(latestEvent, "%F %T") + 4500&lt;/P&gt;</description>
      <pubDate>Sat, 06 Mar 2021 00:55:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-add-time-to-an-event/m-p/542666#M8824</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2021-03-06T00:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to add time to an event</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-add-time-to-an-event/m-p/542674#M8825</link>
      <description>&lt;P&gt;Hi tscroggins,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your quick reply. I tried your recommendation and it helped using&amp;nbsp;&lt;SPAN&gt;| eval Scheduled_Ingestion_Time=strptime(latestEvent, "%F %T") + 4500&lt;/SPAN&gt; , but I have a question:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; I only seem to get results in epoch time example:&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;The time&amp;nbsp; I get is:&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;1613751347.000000&lt;BR /&gt;But I would like to convert it to Unix:&amp;nbsp;2021-02-19 07:00:47.089586&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have tried using&amp;nbsp; | eval&amp;nbsp;Scheduled_Ingestion_Time=strptime(latestArchive,"%Y-%m-%d %H:%M:%S.%3N") + 4500&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;Still get epoch time though.&amp;nbsp; Any guidance on how to tackle this will greatly help.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Mar 2021 02:59:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-add-time-to-an-event/m-p/542674#M8825</guid>
      <dc:creator>Mary666</dc:creator>
      <dc:date>2021-03-06T02:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to add time to an event</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-add-time-to-an-event/m-p/542676#M8826</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/226742"&gt;@Mary666&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have a few options, but the two simplest ones are:&lt;/P&gt;&lt;P&gt;To convert the field back to a string:&lt;/P&gt;&lt;P&gt;| eval&amp;nbsp;&lt;SPAN&gt;Scheduled_Ingestion_Time=strftime(strptime(latestArchive, "%Y-%m-%d %H:%M:%S.%3N") + 4500, "&lt;SPAN&gt;%Y-%m-%d %H:%M:%S.%3N")&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;To leave the field an integer but display it as a string:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| eval&amp;nbsp;Scheduled_Ingestion_Time=strptime(latestArchive, "%Y-%m-%d %H:%M:%S.%3N") + 4500&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| fieldformat&amp;nbsp;&lt;SPAN&gt;Scheduled_Ingestion_Time=strftime(Scheduled_Ingestion_Time, "%Y-%m-%d %H:%M:%S.%3N")&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The time function names can be read as "string from time" and "string parse time."&lt;/P&gt;</description>
      <pubDate>Sat, 06 Mar 2021 03:08:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-add-time-to-an-event/m-p/542676#M8826</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2021-03-06T03:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to add time to an event</title>
      <link>https://community.splunk.com/t5/Reporting/How-to-add-time-to-an-event/m-p/542678#M8827</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Scheduled_Ingestion_Time=strftime(strptime(latestArchive, "%Y-%m-%d %H:%M:%S.%3N") + 4500, "%Y-%m-%d %H:%M:%S.%3N") &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did the trick &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Mar 2021 03:44:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-to-add-time-to-an-event/m-p/542678#M8827</guid>
      <dc:creator>Mary666</dc:creator>
      <dc:date>2021-03-06T03:44:28Z</dc:date>
    </item>
  </channel>
</rss>

