<?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 convert text into numbers - HH:MM:SS into minutes in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/convert-text-into-numbers-HH-MM-SS-into-minutes/m-p/22316#M3830</link>
    <description>&lt;P&gt;I have a field 'vpn_duration' which is taken from the 'Duration:' value in an ASA syslog disconnect message.&lt;/P&gt;

&lt;P&gt;The message looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;May 26 15:15:56 cvpn.X.net May 26 2010 14:58:24: %ASA-4-113019: Group = XVPN, Username = userA, IP = 1.2.3.4, Session disconnected. Session Type: IPsec, Duration: 5h:06m:18s, Bytes xmt: 24875, Bytes rcv: 33036, Reason: Lost Service
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to take the value I get (5h:06m:18s) and convert it into minutes. So, in this case, my result would be 306.&lt;/P&gt;

&lt;P&gt;How can I get this done?&lt;/P&gt;</description>
    <pubDate>Thu, 29 Jul 2010 03:00:29 GMT</pubDate>
    <dc:creator>splunker30039</dc:creator>
    <dc:date>2010-07-29T03:00:29Z</dc:date>
    <item>
      <title>convert text into numbers - HH:MM:SS into minutes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/convert-text-into-numbers-HH-MM-SS-into-minutes/m-p/22316#M3830</link>
      <description>&lt;P&gt;I have a field 'vpn_duration' which is taken from the 'Duration:' value in an ASA syslog disconnect message.&lt;/P&gt;

&lt;P&gt;The message looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;May 26 15:15:56 cvpn.X.net May 26 2010 14:58:24: %ASA-4-113019: Group = XVPN, Username = userA, IP = 1.2.3.4, Session disconnected. Session Type: IPsec, Duration: 5h:06m:18s, Bytes xmt: 24875, Bytes rcv: 33036, Reason: Lost Service
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to take the value I get (5h:06m:18s) and convert it into minutes. So, in this case, my result would be 306.&lt;/P&gt;

&lt;P&gt;How can I get this done?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2010 03:00:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/convert-text-into-numbers-HH-MM-SS-into-minutes/m-p/22316#M3830</guid>
      <dc:creator>splunker30039</dc:creator>
      <dc:date>2010-07-29T03:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: convert text into numbers - HH:MM:SS into minutes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/convert-text-into-numbers-HH-MM-SS-into-minutes/m-p/22317#M3831</link>
      <description>&lt;P&gt;You can use something like the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search terms | rex "Duration: (?&amp;lt;hours&amp;gt;\d+)h:(?&amp;lt;minutes&amp;gt;\d+)m:(?&amp;lt;seconds&amp;gt;\d+)s" | eval duration_minutes = ((hours*60)+minutes+(seconds/60))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Jul 2010 03:12:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/convert-text-into-numbers-HH-MM-SS-into-minutes/m-p/22317#M3831</guid>
      <dc:creator>ftk</dc:creator>
      <dc:date>2010-07-29T03:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: convert text into numbers - HH:MM:SS into minutes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/convert-text-into-numbers-HH-MM-SS-into-minutes/m-p/22318#M3832</link>
      <description>&lt;P&gt;I came up with almost the same thing as ftk, except my ASA has durations &amp;gt; 1d in the logs..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field="_raw" "Duration: (?&amp;amp;lt;dur_day&amp;amp;gt;[0-9]+)?d? *(?&amp;amp;lt;dur_hour&amp;amp;gt;[0-9]+)h?:(?&amp;amp;lt;dur_min&amp;amp;gt;[0-9]+)m?" 
| eval connduration=(if(dur_day=="",0,dur_day)*1440)+(dur_hour * 60)+dur_min
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Jul 2010 03:22:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/convert-text-into-numbers-HH-MM-SS-into-minutes/m-p/22318#M3832</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2010-07-29T03:22:59Z</dc:date>
    </item>
  </channel>
</rss>

