<?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: Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299502#M56643</link>
    <description>&lt;P&gt;Can you please send what the "_time" is for each of these timestamp formats?&lt;/P&gt;</description>
    <pubDate>Tue, 20 Feb 2018 11:31:01 GMT</pubDate>
    <dc:creator>bangalorep</dc:creator>
    <dc:date>2018-02-20T11:31:01Z</dc:date>
    <item>
      <title>Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299501#M56642</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I am trying to create a timechart with data coming from multiple sources. There are two different formats of dates which are coming into the dataset. The two formats are:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Feb 14 2018 4:59PM&lt;BR /&gt;
2018-01-16 09:08:50&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch? &lt;BR /&gt;
Or will I have to write a bunch of if statements which convert them manually, and if so, any hints/ideas? &lt;/P&gt;

&lt;P&gt;Many thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 09:57:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299501#M56642</guid>
      <dc:creator>samwatson45</dc:creator>
      <dc:date>2018-02-20T09:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299502#M56643</link>
      <description>&lt;P&gt;Can you please send what the "_time" is for each of these timestamp formats?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 11:31:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299502#M56643</guid>
      <dc:creator>bangalorep</dc:creator>
      <dc:date>2018-02-20T11:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299503#M56644</link>
      <description>&lt;P&gt;_time comes out in the normal format&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;2018-02-08&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;The issue is the timestamp is the time at which we collected the data from our database, and the time which we want to plot is a variable within the dataset, relating to the recorded time of the events. &lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 11:46:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299503#M56644</guid>
      <dc:creator>samwatson45</dc:creator>
      <dc:date>2018-02-20T11:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299504#M56645</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval A="Feb 14 2018 4:59 PM",B="2018-01-16 09:08:50" 
| table A B 
| eval a=strptime(A, "%b %d %Y %I:%M %p") 
| eval b=strptime(B,"%Y-%m-%d %H:%M:%S")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Try this run anywhere search and you can use the evaluation of a and b.&lt;BR /&gt;
A way forward to automate it would be to use calculated fields where you can use the same evaluations. In order to use calculated fields go to &lt;CODE&gt;Settings » Fields » Calculated fields » Add new&lt;/CODE&gt;&lt;BR /&gt;
and put the eval expression &lt;CODE&gt;strptime(A, "%b %d %Y %I:%M %p")&lt;/CODE&gt; for &lt;CODE&gt;A&lt;/CODE&gt; and repeat the same for &lt;CODE&gt;B&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 13:02:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299504#M56645</guid>
      <dc:creator>bangalorep</dc:creator>
      <dc:date>2018-02-20T13:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299505#M56646</link>
      <description>&lt;P&gt;Your search string works fine for editing individual dates however when I try to add this to the calculated fields it doesn't change the outcome of any of my other searches. &lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 16:04:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299505#M56646</guid>
      <dc:creator>samwatson45</dc:creator>
      <dc:date>2018-02-20T16:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299506#M56647</link>
      <description>&lt;P&gt;The calculated fields create new fields with the epoch time. Do the new fields not work?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 16:08:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299506#M56647</guid>
      <dc:creator>bangalorep</dc:creator>
      <dc:date>2018-02-20T16:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299507#M56648</link>
      <description>&lt;P&gt;I'm not sure if I have done it correctly but they are essentially not changing anything within the search results. &lt;BR /&gt;
Also both the fields (A and B in this case) come in as the same field initially, so do I need a statement to filter them out?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 16:49:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299507#M56648</guid>
      <dc:creator>samwatson45</dc:creator>
      <dc:date>2018-02-20T16:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299508#M56649</link>
      <description>&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/4419iD6C0A8A7120CC22D/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;This creates a new field &lt;CODE&gt;a&lt;/CODE&gt; with the epoch time of &lt;CODE&gt;A&lt;/CODE&gt;. You'll have to use &lt;CODE&gt;a&lt;/CODE&gt; in all your search queries for the epoch time.&lt;/P&gt;

&lt;P&gt;Let me know, if this solves the issue.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 04:21:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299508#M56649</guid>
      <dc:creator>bangalorep</dc:creator>
      <dc:date>2018-02-21T04:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299509#M56650</link>
      <description>&lt;P&gt;It created one of the new field, B_time, and didn't for A. When I try to count by B_time it tells me there is one value for each time. It basically isn't giving me the results I know it should be giving. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:09:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299509#M56650</guid>
      <dc:creator>samwatson45</dc:creator>
      <dc:date>2020-09-29T18:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299510#M56651</link>
      <description>&lt;P&gt;Maybe because I am using essentially the same query for both A and B? That is:&lt;BR /&gt;
eval A_time=strptime(SentToBank, "%b %d %Y %I:%M %p")&lt;BR /&gt;
eval B_time=strptime(SentToBank,"%Y-%m-%d %H:%M:%S")&lt;/P&gt;

&lt;P&gt;[SentToBank being the time variable I am interested in.]&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:10:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299510#M56651</guid>
      <dc:creator>samwatson45</dc:creator>
      <dc:date>2020-09-29T18:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299511#M56652</link>
      <description>&lt;P&gt;Are the two different time formats coming from two different sources?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 04:45:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299511#M56652</guid>
      <dc:creator>bangalorep</dc:creator>
      <dc:date>2018-02-23T04:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299512#M56653</link>
      <description>&lt;P&gt;If the time formats are from different sources you can create, the calculated field based on the source like this&lt;BR /&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/4420i04A5BA9E3A4058D9/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;let me know if this works!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 05:02:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299512#M56653</guid>
      <dc:creator>bangalorep</dc:creator>
      <dc:date>2018-02-23T05:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299513#M56654</link>
      <description>&lt;P&gt;Hiya, &lt;/P&gt;

&lt;P&gt;Yup, that's what I tried however they are from the same source (as in source field).&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 16:22:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299513#M56654</guid>
      <dc:creator>samwatson45</dc:creator>
      <dc:date>2018-02-23T16:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299514#M56655</link>
      <description>&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/4421i72E1EB76D93CB2E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
You can try this . &lt;BR /&gt;
You can add the regex and extract the fields &lt;CODE&gt;Settings » Fields » Field extractions » Add new&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| rex field=A "(?\w+\s\w+\s\w+\s.+)" &lt;BR /&gt;
| rex field=A "(?\w+-\w+-\w+\s.{7,8})" &lt;BR /&gt;
| eval A1 = strptime(a1,"%b %d %Y %I:%M %p") &lt;BR /&gt;
| eval A2 = strptime(a2, "%Y-%m-%d %H:%M:%S") &lt;BR /&gt;
| eval Total = mvappend(A1,A2)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 09:01:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299514#M56655</guid>
      <dc:creator>bangalorep</dc:creator>
      <dc:date>2018-02-26T09:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299515#M56656</link>
      <description>&lt;P&gt;I have tried manipulating your query however I keep getting the same error:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Error in 'rex' command: Encountered the following error while compiling the regex '(?\w+\s\w+\s\w+\s.+)': Regex: unrecognized character after (? or (?-&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;(I am unable to upload an image apparently).&lt;/P&gt;

&lt;P&gt;Does this only work in the field extraction or should it be fine just as a search?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 11:35:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299515#M56656</guid>
      <dc:creator>samwatson45</dc:creator>
      <dc:date>2018-02-26T11:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to set up an automation to detect the type of format the stamp is, and then convert to epoch?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299516#M56657</link>
      <description>&lt;P&gt;Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=A "(?&amp;lt;a1&amp;gt;\w+\s\w+\s\w+\s.+)" 
| rex field=A "(?&amp;lt;a2&amp;gt;\w+-\w+-\w+\s.{7,8})" 
| eval A1 = strptime(a1,"%b %d %Y %I:%M %p") 
| eval A2 = strptime(a2, "%Y-%m-%d %H:%M:%S") 
| eval Total = mvappend(A1,A2)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Feb 2018 11:58:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-any-way-to-set-up-an-automation-to-detect-the-type-of/m-p/299516#M56657</guid>
      <dc:creator>bangalorep</dc:creator>
      <dc:date>2018-02-26T11:58:13Z</dc:date>
    </item>
  </channel>
</rss>

