<?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: Extract selected fields from .txt in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481227#M8559</link>
    <description>&lt;P&gt;HI @vickram , The below should work for you.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&amp;lt;base search&amp;gt;|rex "(?i)MAXDEPTH\((?P&amp;lt;Maxdepth&amp;gt;[^\)]+)"|rex "(?i)CURDEPTH\((?P&amp;lt;Curdepth&amp;gt;[^\)]+)"|stats count by Maxdepth,Curdepth&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2019 14:26:29 GMT</pubDate>
    <dc:creator>vik_splunk</dc:creator>
    <dc:date>2019-09-16T14:26:29Z</dc:date>
    <item>
      <title>Extract selected fields from .txt</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481225#M8557</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;
      I Need to extract " CURDEPTH(553)" and "MAXDEPTH(15000)" as two seperate fields from the below .txt file (below is the sample stanza).  Can you please help.&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;

&lt;P&gt;1 : dis ql('PAPL.ESB.FDS.DELIVERYCONSTRUCT.QUEUE.ESBFDSIns1') curdepth,maxdepth &lt;BR /&gt;
AMQ8409: Display Queue details.&lt;BR /&gt;
   QUEUE(PAPL.ESB.FDS.DELIVERYCONSTRUCT.QUEUE.ESBFDSIns1)&lt;BR /&gt;
   TYPE(QLOCAL)                            CURDEPTH(553)&lt;BR /&gt;
   MAXDEPTH(15000)&lt;BR /&gt;&lt;BR /&gt;
One MQSC command read.&lt;BR /&gt;
No commands have a syntax error.&lt;BR /&gt;
All valid MQSC commands were processed.&lt;BR /&gt;
5724-H72 (C) Copyright IBM Corp. 1994, 2015.&lt;BR /&gt;
Starting MQSC for queue manager PAPL_ESB_FDS_PRD_QM_223.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:11:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481225#M8557</guid>
      <dc:creator>vickram</dc:creator>
      <dc:date>2020-09-30T02:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extract selected fields from .txt</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481226#M8558</link>
      <description>&lt;P&gt;In search you can use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "CURDEPTH\((?&amp;lt;cur_depth&amp;gt;[^\)]+)\)"
| rex "MAXDEPTH\((?&amp;lt;max_depth&amp;gt;[^\)]+)\)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in props you can use the same regex in a &lt;CODE&gt;EXTRACT-field = ...&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 14:13:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481226#M8558</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2019-09-16T14:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Extract selected fields from .txt</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481227#M8559</link>
      <description>&lt;P&gt;HI @vickram , The below should work for you.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&amp;lt;base search&amp;gt;|rex "(?i)MAXDEPTH\((?P&amp;lt;Maxdepth&amp;gt;[^\)]+)"|rex "(?i)CURDEPTH\((?P&amp;lt;Curdepth&amp;gt;[^\)]+)"|stats count by Maxdepth,Curdepth&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 14:26:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481227#M8559</guid>
      <dc:creator>vik_splunk</dc:creator>
      <dc:date>2019-09-16T14:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Extract selected fields from .txt</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481228#M8560</link>
      <description>&lt;P&gt;Works perfectly &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; thanks much&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 14:47:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481228#M8560</guid>
      <dc:creator>vickram</dc:creator>
      <dc:date>2019-09-16T14:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extract selected fields from .txt</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481229#M8561</link>
      <description>&lt;P&gt;Thanks for the help vik&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 14:48:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481229#M8561</guid>
      <dc:creator>vickram</dc:creator>
      <dc:date>2019-09-16T14:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Extract selected fields from .txt</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481230#M8562</link>
      <description>&lt;P&gt;index=aiam_mywizard_esb_queuedepth_analysis&lt;BR /&gt;
|rex "(?i)MAXDEPTH((?P[^)]+)"&lt;BR /&gt;
|rex "(?i)CURDEPTH((?P[^)]+)"&lt;BR /&gt;
|rex "(?i)QUEUE((?P[^)]+)"&lt;BR /&gt;
|rex "(?i)TYPE((?P[^)]+)"&lt;BR /&gt;
| table Maxdepth Curdepth Queue type&lt;/P&gt;

&lt;P&gt;Thanks for the help. I have made the above query. I need to calculate the percentage of the "Maxdepth" field and compare with the "Curdepth" field and find the event When the "Curdepth" reaches 75% of the "Maxdepth".&lt;BR /&gt;
Can you please help on this.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:12:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481230#M8562</guid>
      <dc:creator>vickram</dc:creator>
      <dc:date>2020-09-30T02:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Extract selected fields from .txt</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481231#M8563</link>
      <description>&lt;P&gt;index=aiam_mywizard_esb_queuedepth_analysis&lt;BR /&gt;
|rex "(?i)MAXDEPTH((?P[^)]+)"&lt;BR /&gt;
|rex "(?i)CURDEPTH((?P[^)]+)"&lt;BR /&gt;
|rex "(?i)QUEUE((?P[^)]+)"&lt;BR /&gt;
|rex "(?i)TYPE((?P[^)]+)"&lt;BR /&gt;
| table Maxdepth Curdepth Queue type&lt;/P&gt;

&lt;P&gt;Thanks for the help. I have made the above query. I need to calculate the percentage of the "Maxdepth" field and compare with the "Curdepth" field and find the event When the "Curdepth" reaches 75% of the "Maxdepth".&lt;BR /&gt;
Can you please help on this.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:12:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481231#M8563</guid>
      <dc:creator>vickram</dc:creator>
      <dc:date>2020-09-30T02:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Extract selected fields from .txt</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481232#M8564</link>
      <description>&lt;P&gt;index=aiam_mywizard_esb_queuedepth_analysis&lt;BR /&gt;
|rex "(?i)MAXDEPTH((?P[^)]+)"&lt;BR /&gt;
|rex "(?i)CURDEPTH((?P[^)]+)"&lt;BR /&gt;
|rex "(?i)QUEUE((?P[^)]+)"&lt;BR /&gt;
|rex "(?i)TYPE((?P[^)]+)"&lt;BR /&gt;
| table Maxdepth Curdepth Queue type&lt;/P&gt;

&lt;P&gt;Thanks for the help. I have made the above query. I need to calculate the percentage of the "Maxdepth" field and compare with the "Curdepth" field and find the event When the "Curdepth" reaches 75% of the "Maxdepth".&lt;BR /&gt;
Can you please help on this.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:12:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481232#M8564</guid>
      <dc:creator>vickram</dc:creator>
      <dc:date>2020-09-30T02:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extract selected fields from .txt</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481233#M8565</link>
      <description>&lt;P&gt;Add the below after the current query @vickram &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval Percentage=(Curdepth/Maxdepth)*100|where Percentage&amp;gt;=75
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Sep 2019 05:46:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Extract-selected-fields-from-txt/m-p/481233#M8565</guid>
      <dc:creator>vik_splunk</dc:creator>
      <dc:date>2019-09-17T05:46:50Z</dc:date>
    </item>
  </channel>
</rss>

