<?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: field extraction to value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406278#M117441</link>
    <description>&lt;P&gt;can you share your entire search query?&lt;/P&gt;</description>
    <pubDate>Tue, 22 May 2018 09:36:54 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2018-05-22T09:36:54Z</dc:date>
    <item>
      <title>field extraction to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406273#M117436</link>
      <description>&lt;P&gt;Some of my log lines include&lt;BR /&gt;
"20180228 034322 : [04936] License threshold of 100% reached. There are 202 of 202 licenses in use."&lt;/P&gt;

&lt;P&gt;I want to extract the 100% as a value. &lt;BR /&gt;
I have attempted this but my field extraction is finding occurrences of 100%.&lt;BR /&gt;
last part of search filter is &lt;CODE&gt;field1 = "*License threshold*"|timechart count by licthreshpercent.&lt;/CODE&gt;&lt;BR /&gt;
Regex is &lt;CODE&gt;^[^\]\n]*\]\s+(?P&amp;lt;licthreshkey&amp;gt;\w+\s+\w+\s+\w+)\s+(?P&amp;lt;licthreshpercent&amp;gt;\d+).&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;How can I turn the "100%" into a value to chart against ?&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 08:48:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406273#M117436</guid>
      <dc:creator>browniefs100</dc:creator>
      <dc:date>2018-05-22T08:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: field extraction to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406274#M117437</link>
      <description>&lt;P&gt;I did not understand your question. could you pls explain with sample input and output?&lt;BR /&gt;
As far as I understand you are able to extract it properly right? so once you extract what you want obviously it will tell you occurrences for that value. as for eg.from your entire result set if 100 comes 10 times then it will show you 10 for 100 value.&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 09:08:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406274#M117437</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-05-22T09:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: field extraction to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406275#M117438</link>
      <description>&lt;P&gt;I am looking to extract the value before the '%', not look for occurences of 100% ... in order to setup a chart and alert.&lt;BR /&gt;
I want to be able to chart the % value by time.&lt;BR /&gt;
I hope that clarifies my question.&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 09:15:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406275#M117438</guid>
      <dc:creator>browniefs100</dc:creator>
      <dc:date>2018-05-22T09:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: field extraction to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406276#M117439</link>
      <description>&lt;P&gt;do you want something like this ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart values(licthreshpercent)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 May 2018 09:24:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406276#M117439</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-05-22T09:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: field extraction to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406277#M117440</link>
      <description>&lt;P&gt;I had thought that was a possible solution, but when attempting to specify value (as per your example) I get no results.&lt;BR /&gt;
Are you able to speculate why ?&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 09:32:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406277#M117440</guid>
      <dc:creator>browniefs100</dc:creator>
      <dc:date>2018-05-22T09:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: field extraction to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406278#M117441</link>
      <description>&lt;P&gt;can you share your entire search query?&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 09:36:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406278#M117441</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-05-22T09:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: field extraction to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406279#M117442</link>
      <description>&lt;P&gt;With identifiable data removed it is:&lt;BR /&gt;
host=&amp;lt;&amp;gt; index=&amp;lt;&amp;gt; XXid=&amp;lt;&amp;gt; sourcetype="&amp;lt;&amp;gt;" source="&amp;lt;&amp;gt;" field1="&lt;EM&gt;License threshold&lt;/EM&gt;"| timechart by values(licthreshpercent)&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 09:43:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406279#M117442</guid>
      <dc:creator>browniefs100</dc:creator>
      <dc:date>2018-05-22T09:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: field extraction to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406280#M117443</link>
      <description>&lt;P&gt;remove &lt;CODE&gt;by&lt;/CODE&gt; its just &lt;CODE&gt;| timechart values(licthreshpercent)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 10:10:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406280#M117443</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-05-22T10:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: field extraction to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406281#M117444</link>
      <description>&lt;P&gt;Qh yes ... I added "by" in an attempt to get it returning data.&lt;/P&gt;

&lt;P&gt;host=&amp;lt;&amp;gt; index=&amp;lt;&amp;gt; XXid=&amp;lt;&amp;gt; sourcetype="&amp;lt;&amp;gt;" source="&amp;lt;&amp;gt;" field1="License threshold"| timechart values(licthreshpercent)&lt;/P&gt;

&lt;P&gt;returns "No results found. Try expanding the time range "&lt;/P&gt;

&lt;P&gt;But using" timechart count by licthreshpercent " does give me a timechart, albeit the occurences of  licthreshpercent  .&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 10:33:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406281#M117444</guid>
      <dc:creator>browniefs100</dc:creator>
      <dc:date>2018-05-22T10:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: field extraction to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406282#M117445</link>
      <description>&lt;P&gt;Does your base search return anything without the timechart? &lt;/P&gt;

&lt;P&gt;I am just wondering, as you use &lt;CODE&gt;field1="*License threshold*"&lt;/CODE&gt; in your search, when it is called "licthreshkey" in your field extraction.&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 12:32:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406282#M117445</guid>
      <dc:creator>knielsen</dc:creator>
      <dc:date>2018-05-22T12:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: field extraction to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406283#M117446</link>
      <description>&lt;P&gt;@browniefs100, please try the following Regular Expression &lt;CODE&gt;^(?&amp;lt;time&amp;gt;[^:]+)\:\s\[(?&amp;lt;some_id&amp;gt;[^\]]+)\]\sLicense threshold of (?&amp;lt;threshold_percent&amp;gt;[^%]+)% reached\. There are (?&amp;lt;used_license&amp;gt;[^\s]+)\sof\s(?&amp;lt;total_license&amp;gt;[^\s]+)\slicenses in use\.&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Following is a run anywhere search based on sample data provided:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  makeresults
|  eval _raw="20180228 034322 : [04936] License threshold of 100% reached. There are 202 of 202 licenses in use."
|  rex "^(?&amp;lt;time&amp;gt;[^:]+)\:\s\[(?&amp;lt;some_id&amp;gt;[^\]]+)\]\sLicense threshold of (?&amp;lt;threshold_percent&amp;gt;[^%]+)% reached\. There are (?&amp;lt;used_license&amp;gt;[^\s]+)\sof\s(?&amp;lt;total_license&amp;gt;[^\s]+)\slicenses in use\."
|  eval _time=strptime(trim(time),"%Y%m%d %H%M%S")
|  timechart max(threshold_percent) as threshold_percent
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 May 2018 13:48:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406283#M117446</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-22T13:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: field extraction to value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406284#M117447</link>
      <description>&lt;P&gt;Thanks I will try it.&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 07:50:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/field-extraction-to-value/m-p/406284#M117447</guid>
      <dc:creator>browniefs100</dc:creator>
      <dc:date>2018-05-23T07:50:05Z</dc:date>
    </item>
  </channel>
</rss>

