<?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 extract time from the below message? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-from-the-below-message/m-p/590398#M205556</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244167"&gt;@peterfox1992&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;after the rex command you have to use the eval command for the convertion:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "Search_Button:\s+(?&amp;lt;hours&amp;gt;\d\d):/?&amp;lt;minutes&amp;gt;\d\d):(?&amp;lt;seconds&amp;gt;\d\d\)\.(?&amp;lt;milliseconds&amp;gt;\d\d\d\d\d\d)"
| eval time_milliseconds=(hours*3600+minutes*60+seconds)*1000+milliseconds&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 23 Mar 2022 11:13:21 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-03-23T11:13:21Z</dc:date>
    <item>
      <title>How to extract time from the below message?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-from-the-below-message/m-p/590390#M205550</link>
      <description>&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;Can someone help me on the below. I have the below message in the log and need to extract the time portion alone.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[END~~Method.Search_Button] Response Time Search_Button: 00:00:00.3004626&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The output I need is,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;00:00:00.3004626&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also if possible, can suggest how I can get the value as millisecond? For the above message, I should get 300ms.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If the output is "00:00:01.250" then i should get as 1250ms.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 10:38:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-from-the-below-message/m-p/590390#M205550</guid>
      <dc:creator>peterfox1992</dc:creator>
      <dc:date>2022-03-23T10:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract time from the below message?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-from-the-below-message/m-p/590392#M205552</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244167"&gt;@peterfox1992&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;are you speaking of extract time as a field or as the event TimeStamp?&lt;/P&gt;&lt;P&gt;if as a field, you can use a regex like the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "Search_Button:\s+(?&amp;lt;time&amp;gt;\d\d:\d\d:\d\d\.\d\d\d\d\d\d"&lt;/LI-CODE&gt;&lt;P&gt;if as timestamp, in sourcetype (props.conf) you have to define the following parameters:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[your_sourcetype]
TIME_PREFIX = Search_Button:\s
TIME_FORMAT = %H:%M:%S.%6N&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 10:44:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-from-the-below-message/m-p/590392#M205552</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-03-23T10:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract time from the below message?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-from-the-below-message/m-p/590395#M205554</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;. I have got the required result by using the rex command mentioned.&lt;/P&gt;&lt;P&gt;Now is there any possible to convert the time in millisecond?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If the output is "00:00:01.250" then i should get as 1250ms.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 11:00:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-from-the-below-message/m-p/590395#M205554</guid>
      <dc:creator>peterfox1992</dc:creator>
      <dc:date>2022-03-23T11:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract time from the below message?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-from-the-below-message/m-p/590397#M205555</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352" target="_blank"&gt;@gcusello&lt;/A&gt;&amp;nbsp;. I have got the required result by using the rex command mentioned.&lt;/P&gt;&lt;P&gt;Now is there any possible to convert the time in millisecond?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If the output is "00:00:01.250" then i should get as 1250ms.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 11:06:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-from-the-below-message/m-p/590397#M205555</guid>
      <dc:creator>peterfox1992</dc:creator>
      <dc:date>2022-03-23T11:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract time from the below message?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-from-the-below-message/m-p/590398#M205556</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244167"&gt;@peterfox1992&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;after the rex command you have to use the eval command for the convertion:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "Search_Button:\s+(?&amp;lt;hours&amp;gt;\d\d):/?&amp;lt;minutes&amp;gt;\d\d):(?&amp;lt;seconds&amp;gt;\d\d\)\.(?&amp;lt;milliseconds&amp;gt;\d\d\d\d\d\d)"
| eval time_milliseconds=(hours*3600+minutes*60+seconds)*1000+milliseconds&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 11:13:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-from-the-below-message/m-p/590398#M205556</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-03-23T11:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract time from the below message?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-from-the-below-message/m-p/590407#M205557</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;. It worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 11:56:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-from-the-below-message/m-p/590407#M205557</guid>
      <dc:creator>peterfox1992</dc:creator>
      <dc:date>2022-03-23T11:56:34Z</dc:date>
    </item>
  </channel>
</rss>

