<?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: Parsing Text in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-Text/m-p/44118#M8252</link>
    <description>&lt;P&gt;more updates. /k&lt;/P&gt;</description>
    <pubDate>Fri, 04 May 2012 23:36:17 GMT</pubDate>
    <dc:creator>kristian_kolb</dc:creator>
    <dc:date>2012-05-04T23:36:17Z</dc:date>
    <item>
      <title>Parsing Text</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-Text/m-p/44115#M8249</link>
      <description>&lt;P&gt;I have the following percent values in indexed logfiles:&lt;/P&gt;

&lt;P&gt;Loss=0.00%/0.00% (R/T)&lt;/P&gt;

&lt;P&gt;How can I construct a search query that will only look at the percent values before the '/' (aka 'R' or 'Receive)?&lt;/P&gt;

&lt;P&gt;Conversely how can I construct a search query that will only look at the percent values after the '/' (aka 'T' or 'Transmit')?&lt;/P&gt;

&lt;P&gt;Ultimately I want to create min/max charts for these values...&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;

&lt;P&gt;-Ken&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2012 22:08:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-Text/m-p/44115#M8249</guid>
      <dc:creator>kenosborn</dc:creator>
      <dc:date>2012-05-04T22:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing Text</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-Text/m-p/44116#M8250</link>
      <description>&lt;P&gt;That should be fairly simple&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=your_sourcetype | rex field=Loss "(?&amp;lt;ReceiveLoss&amp;gt;[^%]+)%/(?&amp;lt;TransmitLoss&amp;gt;[^%]+)%"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This would give you two new fields to make charts from.&lt;/P&gt;

&lt;P&gt;This type of field extraction has to be specified as part of the search query, but you could make the extraction more 'permanent' by instead adding the extraction to the &lt;CODE&gt;props.conf&lt;/CODE&gt; stanza for your sourcetype;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
EXTRACT-blah Loss=(?&amp;lt;RecieveLoss&amp;gt;[^%]+)%/(?&amp;lt;TransmitLoss&amp;gt;[^%]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Either way, once you have the fields extracted, you could create charts with &lt;CODE&gt;timechart&lt;/CODE&gt; or &lt;CODE&gt;chart&lt;/CODE&gt;;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search |timechart span=5m max(ReceiveLoss) AS MaxRLoss min(ReceiveLoss) AS MinRLoss max(TransmitLoss) AS MaxTLoss min(TransmitLoss) AS MinTLoss
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then you can save it to a dashboard as a line chart or whatever you like.&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2012 22:41:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-Text/m-p/44116#M8250</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-05-04T22:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing Text</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-Text/m-p/44117#M8251</link>
      <description>&lt;P&gt;updated and fixed an error. /k&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2012 22:48:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-Text/m-p/44117#M8251</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-05-04T22:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing Text</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-Text/m-p/44118#M8252</link>
      <description>&lt;P&gt;more updates. /k&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2012 23:36:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-Text/m-p/44118#M8252</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-05-04T23:36:17Z</dc:date>
    </item>
  </channel>
</rss>

