<?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: How do I group unstructured events based on errorcode that they contain in body? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-group-unstructured-events-based-on-errorcode-that-they/m-p/498984#M85058</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="{\"Errors\":{\"Error\":{\"RequestId\":\"112314082\",\"Source\":\"\",\"ReasonCode\":\"MISSING_REQUIRED_INPUT\",\"Description\":\"Missing Required Input\",\"Recoverable\":\"false\",\"Details\":{\"Detail\":{\"Name\":\"ErrorDetailCode\",\"Value\":\"092000\"}}}}}
{\"Errors\":{\"Error\":{\"RequestId\":\"112314082\",\"Source\":\"\",\"ReasonCode\":\"MISSING_REQUIRED_INPUT\",\"Description\":\"Missing Required Input\",\"Recoverable\":\"false\",\"Details\":{\"Detail\":{\"Name\":\"ErrorDetailCode\",\"Value\":\"092001\"}}}}}
{\"Errors\":{\"Error\":{\"RequestId\":\"112314082\",\"Source\":\"\",\"ReasonCode\":\"MISSING_REQUIRED_INPUT\",\"Description\":\"Missing Required Input\",\"Recoverable\":\"false\",\"Details\":{\"Detail\":{\"Name\":\"ErrorDetailCode\",\"Value\":\"092000\"}}}}}
{\"Errors\":{\"Error\":{\"RequestId\":\"112314082\",\"Source\":\"\",\"ReasonCode\":\"MISSING_REQUIRED_INPUT\",\"Description\":\"Missing Required Input\",\"Recoverable\":\"false\",\"Details\":{\"Detail\":{\"Name\":\"ErrorDetailCode\",\"Value\":\"092002\"}}}}}"
| eval raw=split(_raw,"
")
| mvexpand raw
| rename raw as _raw
`comment("this is your sample")`
`comment("From here, the logic")`
| spath path=Errors.Error.Details.Detail.Value output=ErrorCode
| stats count by ErrorCode
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, how about this?&lt;/P&gt;</description>
    <pubDate>Fri, 31 Jan 2020 11:53:54 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-01-31T11:53:54Z</dc:date>
    <item>
      <title>How do I group unstructured events based on errorcode that they contain in body?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-group-unstructured-events-based-on-errorcode-that-they/m-p/498982#M85056</link>
      <description>&lt;P&gt;I have some base splunk query which gives me list of events which has body mentioned below -&lt;/P&gt;

&lt;P&gt;event 1.&lt;BR /&gt;&lt;BR /&gt;
{"Errors":{"Error":{"RequestId":"112314082","Source":"","ReasonCode":"MISSING_REQUIRED_INPUT","Description":"Missing Required Input","Recoverable":"false","Details":{"Detail":{"Name":"ErrorDetailCode","Value":"092000"}}}}}&lt;/P&gt;

&lt;P&gt;event 2.&lt;BR /&gt;&lt;BR /&gt;
{"Errors":{"Error":{"RequestId":"112314082","Source":"","ReasonCode":"MISSING_REQUIRED_INPUT","Description":"Missing Required Input","Recoverable":"false","Details":{"Detail":{"Name":"ErrorDetailCode","Value":"092001"}}}}}&lt;/P&gt;

&lt;P&gt;event  3.&lt;BR /&gt;&lt;BR /&gt;
{"Errors":{"Error":{"RequestId":"112314082","Source":"","ReasonCode":"MISSING_REQUIRED_INPUT","Description":"Missing Required Input","Recoverable":"false","Details":{"Detail":{"Name":"ErrorDetailCode","Value":"092000"}}}}}&lt;/P&gt;

&lt;P&gt;event  4. &lt;BR /&gt;
{"Errors":{"Error":{"RequestId":"112314082","Source":"","ReasonCode":"MISSING_REQUIRED_INPUT","Description":"Missing Required Input","Recoverable":"false","Details":{"Detail":{"Name":"ErrorDetailCode","Value":"092002"}}}}}&lt;/P&gt;

&lt;P&gt;I need to group these events based on message body's ErrorDetailCode value.&lt;BR /&gt;
e.g. &lt;BR /&gt;
ErrorCode         Count&lt;/P&gt;

&lt;P&gt;092000 -                2&lt;BR /&gt;
092001 -                1&lt;BR /&gt;
092002 -                1&lt;/P&gt;

&lt;P&gt;Can someone please help me or guide me to build as I am new to Splunk ?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:58:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-group-unstructured-events-based-on-errorcode-that-they/m-p/498982#M85056</guid>
      <dc:creator>dhirajnangar</dc:creator>
      <dc:date>2020-09-30T03:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I group unstructured events based on errorcode that they contain in body?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-group-unstructured-events-based-on-errorcode-that-they/m-p/498983#M85057</link>
      <description>&lt;P&gt;Hi @dhirajnangar try:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;...your serach|rex field=_raw "ErrorDetailCode.+Value\":\"(?P&amp;lt;errorCode&amp;gt;\d+)" |stats count by errorCode&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 18:41:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-group-unstructured-events-based-on-errorcode-that-they/m-p/498983#M85057</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2020-01-30T18:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I group unstructured events based on errorcode that they contain in body?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-group-unstructured-events-based-on-errorcode-that-they/m-p/498984#M85058</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="{\"Errors\":{\"Error\":{\"RequestId\":\"112314082\",\"Source\":\"\",\"ReasonCode\":\"MISSING_REQUIRED_INPUT\",\"Description\":\"Missing Required Input\",\"Recoverable\":\"false\",\"Details\":{\"Detail\":{\"Name\":\"ErrorDetailCode\",\"Value\":\"092000\"}}}}}
{\"Errors\":{\"Error\":{\"RequestId\":\"112314082\",\"Source\":\"\",\"ReasonCode\":\"MISSING_REQUIRED_INPUT\",\"Description\":\"Missing Required Input\",\"Recoverable\":\"false\",\"Details\":{\"Detail\":{\"Name\":\"ErrorDetailCode\",\"Value\":\"092001\"}}}}}
{\"Errors\":{\"Error\":{\"RequestId\":\"112314082\",\"Source\":\"\",\"ReasonCode\":\"MISSING_REQUIRED_INPUT\",\"Description\":\"Missing Required Input\",\"Recoverable\":\"false\",\"Details\":{\"Detail\":{\"Name\":\"ErrorDetailCode\",\"Value\":\"092000\"}}}}}
{\"Errors\":{\"Error\":{\"RequestId\":\"112314082\",\"Source\":\"\",\"ReasonCode\":\"MISSING_REQUIRED_INPUT\",\"Description\":\"Missing Required Input\",\"Recoverable\":\"false\",\"Details\":{\"Detail\":{\"Name\":\"ErrorDetailCode\",\"Value\":\"092002\"}}}}}"
| eval raw=split(_raw,"
")
| mvexpand raw
| rename raw as _raw
`comment("this is your sample")`
`comment("From here, the logic")`
| spath path=Errors.Error.Details.Detail.Value output=ErrorCode
| stats count by ErrorCode
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, how about this?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 11:53:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-group-unstructured-events-based-on-errorcode-that-they/m-p/498984#M85058</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-31T11:53:54Z</dc:date>
    </item>
  </channel>
</rss>

