<?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: stats count for a text value associated with a number in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539773#M152673</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;thanks a lot, this worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 13 Feb 2021 02:02:23 GMT</pubDate>
    <dc:creator>lazyturtle_</dc:creator>
    <dc:date>2021-02-13T02:02:23Z</dc:date>
    <item>
      <title>stats count for a text value associated with a number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539606#M152604</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I am stuck in a situation where in my app logs there are two important values(one is a number and other is a text string) are being captured and I need to draw a stats count using these two values.&lt;BR /&gt;so here is the base query:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class="p1"&gt;index=Myapp sourcetype=weblogic "ReservationConfirmRS returned errors for TrainId"&lt;/P&gt;&lt;P class="p1"&gt;| dedup requestId sortBy -_time | timechart count span=1d&lt;BR /&gt;&lt;BR /&gt;the log looks like below:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class="p1"&gt;ReservId=30010632019 billingCurrency=“INR”,Status=7000, Error='ReservationConfirmRS returned errors for TrainId &lt;U&gt;45732&lt;/U&gt;&amp;nbsp;and reference number null&lt;U&gt;[The trxn could not been confirmed. Please try again. Cause: ]’&lt;/U&gt;,travelerType=3&lt;BR /&gt;&lt;BR /&gt;so the 'TrainId' and text in bracket [text-string] would be different, and I need to draw a stats count for these two values.&lt;/P&gt;&lt;P class="p1"&gt;&lt;BR /&gt;Please help!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 03:10:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539606#M152604</guid>
      <dc:creator>lazyturtle_</dc:creator>
      <dc:date>2021-02-12T03:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: stats count for a text value associated with a number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539611#M152608</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231473"&gt;@lazyturtle_&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Please try below;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "ReservationConfirmRS\sreturned\serrors\sfor\sTrainId\s(?&amp;lt;TrainId&amp;gt;\d+).+\[(?&amp;lt;text_string&amp;gt;[^\]]+)"
| timechart span=1d count(TrainId) TrainId count(text_string) as text_string&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 12 Feb 2021 03:58:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539611#M152608</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-02-12T03:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: stats count for a text value associated with a number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539614#M152610</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;I tried your solution but that didn't give me the desired out put, as I said in the error message the 'TrainId' and error string in the bracket could be different, some of the examples below:&lt;/P&gt;&lt;P class="p1"&gt;- ReservationConfirmRS returned errors for TrainId 12411 and reference number null[There is a Stop sale for TrainId: 12411,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;fromDate: 2021-02-12, toDate: 2021-02-22]&lt;/P&gt;&lt;P class="p1"&gt;- ReservationConfirmRS returned errors for TrainId 12973 and reference number null[The trxn could not been confirmed. Please try again. Cause&lt;SPAN class="s1"&gt;:&lt;/SPAN&gt; ]'&lt;/P&gt;&lt;P class="p1"&gt;- ReservationConfirmRS returned errors for TrainId 23765 and reference number null[[There was one error in the communication with the reservation system]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lazyturtle__0-1613103377688.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/12915i0FEC3804FE8A3573/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lazyturtle__0-1613103377688.png" alt="lazyturtle__0-1613103377688.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 04:16:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539614#M152610</guid>
      <dc:creator>lazyturtle_</dc:creator>
      <dc:date>2021-02-12T04:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: stats count for a text value associated with a number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539615#M152611</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231473"&gt;@lazyturtle_&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I think I couldn't get your need. Regex is extracting these values and calculates daily count.&lt;/P&gt;&lt;P&gt;If you can put a sample desired output table based on your last three sample data, I will try again.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 04:30:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539615#M152611</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-02-12T04:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: stats count for a text value associated with a number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539616#M152612</link>
      <description>&lt;P&gt;&lt;SPAN&gt;ReservId=30010632019 billingCurrency=“INR”,Status=7000, Error='ReservationConfirmRS returned errors for TrainId&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;45732&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;and reference number null&lt;/SPAN&gt;&lt;U&gt;[The trxn could not been confirmed. Please try again. Cause: ]’&lt;/U&gt;&lt;SPAN&gt;,travelerType=3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ReservId=30010632020 billingCurrency=“INR”,Status=6000, Error='ReservationConfirmRS returned errors for TrainId 12411 and reference number null[There is a Stop sale for TrainId: 12411,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;fromDate: 2021-02-12, toDate: 2021-02-22]',travelerType=2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ReservId=30010632021 billingCurrency=“INR”,Status=7000, Error='ReservationConfirmRS returned errors for TrainId 23765 and reference number null[[There was one error in the communication with the reservation system]',travelerType=3&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 04:40:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539616#M152612</guid>
      <dc:creator>lazyturtle_</dc:creator>
      <dc:date>2021-02-12T04:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: stats count for a text value associated with a number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539622#M152614</link>
      <description>&lt;P&gt;I meant the desired output, what you want to see as a result of these three events.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 06:00:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539622#M152614</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-02-12T06:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: stats count for a text value associated with a number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539623#M152615</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;the desired output should be like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE width="983"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="87"&gt;TrainId&lt;/TD&gt;&lt;TD width="809"&gt;errorMsg&lt;/TD&gt;&lt;TD width="87"&gt;Count&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;45732&lt;/TD&gt;&lt;TD&gt;The trxn could not been confirmed. Please try again. Cause:&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12411&lt;/TD&gt;&lt;TD&gt;The trxn could not been confirmed. Please try again. Cause:&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;45732&lt;/TD&gt;&lt;TD&gt;There is a Stop sale for TrainId: 12411,&amp;nbsp; fromDate: 2021-02-12, toDate: 2021-02-22&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12411&lt;/TD&gt;&lt;TD&gt;The trxn could not been confirmed. Please try again. Cause:&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;23765&lt;/TD&gt;&lt;TD&gt;There was one error in the communication with the reservation system&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;45732&lt;/TD&gt;&lt;TD&gt;There was one error in the communication with the reservation system&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12411&lt;/TD&gt;&lt;TD&gt;There was one error in the communication with the reservation system&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Thank you.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 06:07:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539623#M152615</guid>
      <dc:creator>lazyturtle_</dc:creator>
      <dc:date>2021-02-12T06:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: stats count for a text value associated with a number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539634#M152617</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231473"&gt;@lazyturtle_&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you, I think below will work for you;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "ReservationConfirmRS\sreturned\serrors\sfor\sTrainId\s(?&amp;lt;TrainId&amp;gt;\d+).+\[(?&amp;lt;errorMsg&amp;gt;[^\]]+)"
| stats count by TrainId errorMsg&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 12 Feb 2021 07:34:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539634#M152617</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-02-12T07:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: stats count for a text value associated with a number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539773#M152673</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;thanks a lot, this worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Feb 2021 02:02:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-count-for-a-text-value-associated-with-a-number/m-p/539773#M152673</guid>
      <dc:creator>lazyturtle_</dc:creator>
      <dc:date>2021-02-13T02:02:23Z</dc:date>
    </item>
  </channel>
</rss>

