<?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: Help with rex regex to extract a field value for a chart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-regex-to-extract-a-field-value-for-a-chart/m-p/188843#M54411</link>
    <description>&lt;P&gt;Yes.  You have to have some function to aggregate all results falling into the same time slot.  Examples would be avg() or sum().&lt;/P&gt;</description>
    <pubDate>Thu, 21 Aug 2014 23:53:01 GMT</pubDate>
    <dc:creator>grijhwani</dc:creator>
    <dc:date>2014-08-21T23:53:01Z</dc:date>
    <item>
      <title>Help with rex regex to extract a field value for a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-regex-to-extract-a-field-value-for-a-chart/m-p/188838#M54406</link>
      <description>&lt;P&gt;I have a search that will return the log entry below.  The search is here:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt; "Authentication succeeded for user [*] in tenant [vsphere.local] in [*] milliseconds" host=valuetonarowdownhost &amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Text&lt;BR /&gt;
Authentication succeeded for user [userid@domain] in tenant [vsphere.local] in [185] milliseconds&lt;/P&gt;

&lt;P&gt;But I would like to create a rex value for any integer between the last brackets (here it's 185) and then create a chart for it.  I'm trying to trend on how long it takes to authenticate a user.  Been trying in vain to come up with an expression that works for me.&lt;/P&gt;

&lt;P&gt;Any help appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2014 17:34:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-regex-to-extract-a-field-value-for-a-chart/m-p/188838#M54406</guid>
      <dc:creator>mark_chuman</dc:creator>
      <dc:date>2014-08-20T17:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex regex to extract a field value for a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-regex-to-extract-a-field-value-for-a-chart/m-p/188839#M54407</link>
      <description>&lt;P&gt;The quickest solution to the problem would be to use the interactive field extractor tool.  That will give you a rex pattern you can work with, although having generated the field extraction, you could just save it and use it by name.&lt;/P&gt;

&lt;P&gt;The following might suit your needs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "^.*\[.*\[.*\[(?P&amp;lt;millisec&amp;gt;[0-9]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Aug 2014 17:54:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-regex-to-extract-a-field-value-for-a-chart/m-p/188839#M54407</guid>
      <dc:creator>grijhwani</dc:creator>
      <dc:date>2014-08-20T17:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex regex to extract a field value for a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-regex-to-extract-a-field-value-for-a-chart/m-p/188840#M54408</link>
      <description>&lt;P&gt;Thank you, very powerful.  It's working now, in that I'm able to chart out the average of that specific value (I'll call it logon_time) and I have a field now called logon_time.  So, I'll have the search and then add on | timechart avg(logon_time).  That gives me the daily average for that value over time using the logs from all the hosts.  Any idea how I would expose the average for each host and have it overlap on the same chart?  Also, I don't necessarily need the average, but just the raw value.  I was trying something like | select time_logon | timechart count by host..&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:22:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-regex-to-extract-a-field-value-for-a-chart/m-p/188840#M54408</guid>
      <dc:creator>mark_chuman</dc:creator>
      <dc:date>2020-09-28T17:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex regex to extract a field value for a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-regex-to-extract-a-field-value-for-a-chart/m-p/188841#M54409</link>
      <description>&lt;P&gt;Try something like this (for your followup question)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex "^.*\[.*\[.*\[(?P&amp;lt;logon_time&amp;gt;[0-9]+)" | eval host="host_".host| timechart avg(logon_time) by host | addtotals fieldname=AllHosts host_* | rename host_* as *
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Aug 2014 19:45:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-regex-to-extract-a-field-value-for-a-chart/m-p/188841#M54409</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-20T19:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex regex to extract a field value for a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-regex-to-extract-a-field-value-for-a-chart/m-p/188842#M54410</link>
      <description>&lt;P&gt;Thanks!  Any reason why wouldn't be able to adjust this part - |timechart avg(logon_time) to | timechart (logon_time) - ie, you just want the raw data and not have it averaged.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:22:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-regex-to-extract-a-field-value-for-a-chart/m-p/188842#M54410</guid>
      <dc:creator>mark_chuman</dc:creator>
      <dc:date>2020-09-28T17:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex regex to extract a field value for a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-regex-to-extract-a-field-value-for-a-chart/m-p/188843#M54411</link>
      <description>&lt;P&gt;Yes.  You have to have some function to aggregate all results falling into the same time slot.  Examples would be avg() or sum().&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2014 23:53:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-regex-to-extract-a-field-value-for-a-chart/m-p/188843#M54411</guid>
      <dc:creator>grijhwani</dc:creator>
      <dc:date>2014-08-21T23:53:01Z</dc:date>
    </item>
  </channel>
</rss>

