<?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 get sum and charts of usage time values for corresponding fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-and-charts-of-usage-time-values-for-corresponding/m-p/110446#M28881</link>
    <description>&lt;P&gt;You could either use the field extractor UI to try and solve it, or you could use rex on the search line to handle the same.&lt;/P&gt;

&lt;P&gt;Something like (untested, but probably close);&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex "Camera (?P&amp;lt;CameraSite&amp;gt;.+) has been closed after being in use for (?P&amp;lt;UsageTime&amp;gt;\d*) seconds" | chart sum(UsageTime) by CameraSite
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 18 Jun 2014 20:03:34 GMT</pubDate>
    <dc:creator>jeremiahc4</dc:creator>
    <dc:date>2014-06-18T20:03:34Z</dc:date>
    <item>
      <title>How to get sum and charts of usage time values for corresponding fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-and-charts-of-usage-time-values-for-corresponding/m-p/110445#M28880</link>
      <description>&lt;P&gt;I'm using splunk 6.0.3&lt;/P&gt;

&lt;P&gt;When I search for:  "has been closed after being in use"&lt;BR /&gt;
I have a series of hits like shown in the 4 sample lines below:&lt;/P&gt;

&lt;P&gt;2014-06-17 18:26:47.219765 (UTC) Camera SITENAME-1.camera.CAMERANAME-1 has been closed after being in use for 175 seconds in automatic mode&lt;/P&gt;

&lt;P&gt;2014-06-18 14:48:30.241732 (UTC) Camera SITENAME-2.camera.CAMERANAME-2 has been closed after being in use for 281 seconds in manual mode&lt;/P&gt;

&lt;P&gt;2014-06-18 15:52:53.974993 (UTC) Camera SITENAME-3.camera.CAMERANAME-3 has been closed after being in use for 5494 seconds in Unknown mode&lt;/P&gt;

&lt;P&gt;2014-06-18 15:53:10.312491 (UTC) Camera SITENAME-4.camera.CAMERANAME-4 has been closed after being in use for 5511 seconds in watching mode&lt;/P&gt;

&lt;P&gt;How can a do a search, to report the total usage time, for each camera, at each site, in each mode?&lt;/P&gt;

&lt;P&gt;and.. print pretty charts and plots?&lt;BR /&gt;
thanks!&lt;/P&gt;

&lt;P&gt;&lt;A href="mailto:Fred.Ziegler@alum.mit.edu"&gt;Fred.Ziegler@alum.mit.edu&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jun 2014 19:58:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-and-charts-of-usage-time-values-for-corresponding/m-p/110445#M28880</guid>
      <dc:creator>fziegler</dc:creator>
      <dc:date>2014-06-18T19:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to get sum and charts of usage time values for corresponding fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-and-charts-of-usage-time-values-for-corresponding/m-p/110446#M28881</link>
      <description>&lt;P&gt;You could either use the field extractor UI to try and solve it, or you could use rex on the search line to handle the same.&lt;/P&gt;

&lt;P&gt;Something like (untested, but probably close);&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex "Camera (?P&amp;lt;CameraSite&amp;gt;.+) has been closed after being in use for (?P&amp;lt;UsageTime&amp;gt;\d*) seconds" | chart sum(UsageTime) by CameraSite
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Jun 2014 20:03:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-and-charts-of-usage-time-values-for-corresponding/m-p/110446#M28881</guid>
      <dc:creator>jeremiahc4</dc:creator>
      <dc:date>2014-06-18T20:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to get sum and charts of usage time values for corresponding fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-and-charts-of-usage-time-values-for-corresponding/m-p/110447#M28882</link>
      <description>&lt;P&gt;You probably need to modify the regex ".+" in the CameraSite field to capture the full name... I usually have to play around with it, but could either be something like &lt;/P&gt;

&lt;P&gt;(?P&lt;CAMERASITE&gt;[\w\d\-\.]*) or (?P&lt;CAMERASITE&gt;.*[^ ])&lt;/CAMERASITE&gt;&lt;/CAMERASITE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jun 2014 20:06:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-and-charts-of-usage-time-values-for-corresponding/m-p/110447#M28882</guid>
      <dc:creator>jeremiahc4</dc:creator>
      <dc:date>2014-06-18T20:06:39Z</dc:date>
    </item>
  </channel>
</rss>

