<?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 to group messages based on substring in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654819#M226203</link>
    <description>&lt;P&gt;Please can you share some anonymised versions of your events as it is unclear what originalField refers to nor whether you already have extracted the JSON fields&lt;/P&gt;</description>
    <pubDate>Fri, 18 Aug 2023 08:33:55 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-08-18T08:33:55Z</dc:date>
    <item>
      <title>How to group messages based on substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654813#M226199</link>
      <description>&lt;DIV&gt;&lt;P&gt;Hello community. I'm trying to extract information from a string type field and make a graph on a dashboard. In the graph, I want to group identical messages. I encounter difficulties when grouping a type of message that contains information about an id, which is different for each message and respectively for each message it returns a separate value. Ex. message: {"status":"SUCCESS","id":"123456789"}. I use this query:&lt;/P&gt;&lt;PRE&gt;"source" originalField AND ("SUCCESS" OR "FAILURE") | stats count by originalField &lt;/PRE&gt;&lt;P&gt;This query groups my fields that contain a FAILURE status, but does not group the SUCCESS ones because they have different IDs. I tried different substrings but it doesn't work. Can someone give me a solution?&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 18 Aug 2023 08:30:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654813#M226199</guid>
      <dc:creator>chimuru84</dc:creator>
      <dc:date>2023-08-18T08:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to group messages based on substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654819#M226203</link>
      <description>&lt;P&gt;Please can you share some anonymised versions of your events as it is unclear what originalField refers to nor whether you already have extracted the JSON fields&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 08:33:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654819#M226203</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-18T08:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to group messages based on substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654821#M226204</link>
      <description>&lt;P&gt;Let me help you format the question so others can easily read&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/259797"&gt;@chimuru84&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;DIV&gt;&lt;P&gt;Hello community. I'm trying to extract information from a string type field and make a graph on a dashboard. In the graph, I want to group identical messages. I encounter difficulties when grouping a type of message that contains information about an id, which is different for each message and respectively for each message it returns a separate value. Ex. message: {"status":"SUCCESS","id":"123456789"}. I use this query:&lt;/P&gt;&lt;PRE&gt;"source" originalField AND ("SUCCESS" OR "FAILURE") | stats count by originalField &lt;/PRE&gt;&lt;P&gt;This query groups my fields that contain a FAILURE status, but does not group the SUCCESS ones because they have different IDs. I tried different substrings but it doesn't work. Can someone give me a solution?&lt;/P&gt;&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The description is very unclear. &amp;nbsp;What is the relationship between "originalField" and SUCCESS or FAILURE, or with the groupby you desired? &amp;nbsp;If you group by originalField, you get a breakdown by originalField. &amp;nbsp;There can be no other outcome. &amp;nbsp;Can you exemplify some events that your search returns, and show the stats result, then explain why that result is not what you need? &amp;nbsp;Maybe illustrate your desired result with that sample dataset.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 08:38:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654821#M226204</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-08-18T08:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to group messages based on substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654829#M226206</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.jpg" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/26867i5EF302D11A9BD6F4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="1.jpg" alt="1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;After I use this query, I have a result like this. For different reasons for status failure, I have grouped messages, but for status success, every message is separate because of his Id.&amp;nbsp; And the result looks like a JSON but is type String.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 08:56:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654829#M226206</guid>
      <dc:creator>chimuru84</dc:creator>
      <dc:date>2023-08-18T08:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to group messages based on substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654830#M226207</link>
      <description>&lt;P&gt;Replace the id in original field with another string&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"source" originalField AND ("SUCCESS" OR "FAILURE") 
| rex mode=sed field=originalField "s/SUCCESS\",\"id\":\"[^\"]+\"/SUCCESS\",\"id\":\"id\"/g"
| stats count by originalField&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 18 Aug 2023 09:07:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654830#M226207</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-18T09:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to group messages based on substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654880#M226227</link>
      <description>&lt;P&gt;It works. Thank you. Now I saw that I have one more kind of success message. How can I group this message too?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.jpg" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/26873iE1F89D4AFCADCEA6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2.jpg" alt="2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 14:26:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654880#M226227</guid>
      <dc:creator>chimuru84</dc:creator>
      <dc:date>2023-08-18T14:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to group messages based on substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654881#M226228</link>
      <description>&lt;LI-CODE lang="markup"&gt;"source" originalField AND ("SUCCESS" OR "FAILURE") 
| rex mode=sed field=originalField "s/SUCCESS\",\"(id|detailedReason)\":\"[^\"]+\"/SUCCESS\"/g"
| stats count by originalField&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 18 Aug 2023 14:30:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654881#M226228</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-18T14:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to group messages based on substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654882#M226229</link>
      <description>&lt;P&gt;with this query messages with success are not grouped. I want to have one group with success and another with success/detailedReason. Is possible that? Thank You&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 14:36:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654882#M226229</guid>
      <dc:creator>chimuru84</dc:creator>
      <dc:date>2023-08-18T14:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to group messages based on substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654883#M226230</link>
      <description>&lt;P&gt;Because you have hidden what your event looks like, it is difficult for me to define a solution that works for you. Please share some sample events, with just the most sensitive parts obscured.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 14:44:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654883#M226230</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-18T14:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to group messages based on substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654885#M226231</link>
      <description>&lt;P&gt; This is how 2 success messages looks like. And I want to make 2 groups. For first, 1 query works fine, for second need to add to this query something. Thanks you.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.jpg" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/26874i7F349F9D0EB92F17/image-size/medium?v=v2&amp;amp;px=400" role="button" title="3.jpg" alt="3.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 14:47:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654885#M226231</guid>
      <dc:creator>chimuru84</dc:creator>
      <dc:date>2023-08-18T14:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to group messages based on substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654894#M226233</link>
      <description>&lt;LI-CODE lang="markup"&gt;"source" originalField AND ("SUCCESS" OR "FAILURE") 
| rex mode=sed field=originalField "s/SUCCESS\",\"accountId\":\"[^\"]+\"/SUCCESS\",\"accountId\":\"accountId\"/g"
| rex mode=sed field=originalField "s/SUCCESS\",\"detailedReason\":\"[^\"]+\",\"accountId\":\"[^\"]+\"/SUCCESS\",\"detailedReason\":\"detailedReason\",\"accountId\":\"accountId\"/g"
| stats count by originalField&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 18 Aug 2023 15:33:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654894#M226233</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-18T15:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to group messages based on substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654896#M226235</link>
      <description>&lt;P&gt;Thanks a lot!! Everything woks fine!&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 15:37:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/654896#M226235</guid>
      <dc:creator>chimuru84</dc:creator>
      <dc:date>2023-08-18T15:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to group messages based on substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/668507#M229333</link>
      <description>&lt;P&gt;Sorry for late answer. By "\"source\" originalField" I mean field which contains&amp;nbsp; this kind of logs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 09:57:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-messages-based-on-substring/m-p/668507#M229333</guid>
      <dc:creator>chimuru84</dc:creator>
      <dc:date>2023-11-14T09:57:52Z</dc:date>
    </item>
  </channel>
</rss>

