<?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 How to edit a rex search in order to find the average duration time between two fields? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-a-rex-search-in-order-to-find-the-average-duration/m-p/269029#M51662</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm currently have issues parsing the duration I've created to find the average time between 2 fields based on a set of logs.&lt;BR /&gt;
In  short, the field I'm trying to parse is in this format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;35+00:06:47.000000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And I'm using this rex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=diff "(?&amp;lt;durationDays&amp;gt;\d+)+(?&amp;lt;durationHours&amp;gt;\d+):(?&amp;lt;durationMinutes&amp;gt;\d+):(?&amp;lt;durationSeconds&amp;gt;.*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, the "durationDays" here is coming out completely wrong, and is actually an optional field since many of the logs will have less than 1 day. What's the best way to approach this?&lt;/P&gt;</description>
    <pubDate>Thu, 08 Dec 2016 19:00:35 GMT</pubDate>
    <dc:creator>anthonycopus</dc:creator>
    <dc:date>2016-12-08T19:00:35Z</dc:date>
    <item>
      <title>How to edit a rex search in order to find the average duration time between two fields?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-a-rex-search-in-order-to-find-the-average-duration/m-p/269029#M51662</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm currently have issues parsing the duration I've created to find the average time between 2 fields based on a set of logs.&lt;BR /&gt;
In  short, the field I'm trying to parse is in this format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;35+00:06:47.000000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And I'm using this rex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=diff "(?&amp;lt;durationDays&amp;gt;\d+)+(?&amp;lt;durationHours&amp;gt;\d+):(?&amp;lt;durationMinutes&amp;gt;\d+):(?&amp;lt;durationSeconds&amp;gt;.*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, the "durationDays" here is coming out completely wrong, and is actually an optional field since many of the logs will have less than 1 day. What's the best way to approach this?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2016 19:00:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-a-rex-search-in-order-to-find-the-average-duration/m-p/269029#M51662</guid>
      <dc:creator>anthonycopus</dc:creator>
      <dc:date>2016-12-08T19:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit a rex search in order to find the average duration time between two fields?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-a-rex-search-in-order-to-find-the-average-duration/m-p/269030#M51663</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval date="35+00:06:47.000000%35+00:06:47.000000%+00:06:47.000000%00:06:47.000000" | rex field=date max_match=0 "(?&amp;lt;date&amp;gt;[^%]+)" | mvexpand date | table date | rex field=date "(?&amp;lt;durationDays&amp;gt;\d+)?\+?(?&amp;lt;durationHours&amp;gt;\d{2}):(?&amp;lt;durationMinutes&amp;gt;\d{2}):(?&amp;lt;durationSeconds&amp;gt;\d{2}\.\d{6})"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Dec 2016 19:07:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-a-rex-search-in-order-to-find-the-average-duration/m-p/269030#M51663</guid>
      <dc:creator>bshuler_splunk</dc:creator>
      <dc:date>2016-12-08T19:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit a rex search in order to find the average duration time between two fields?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-a-rex-search-in-order-to-find-the-average-duration/m-p/269031#M51664</link>
      <description>&lt;P&gt;Perfect, thanks a lot!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2016 19:18:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-a-rex-search-in-order-to-find-the-average-duration/m-p/269031#M51664</guid>
      <dc:creator>anthonycopus</dc:creator>
      <dc:date>2016-12-08T19:18:24Z</dc:date>
    </item>
  </channel>
</rss>

