<?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 XML request events in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-group-XML-request-events/m-p/654343#M11152</link>
    <description>&lt;P&gt;You can use spath to extract fields from XML (as well as JSON).&lt;/P&gt;&lt;P&gt;Perhaps if you could share some anonymised events, we might be able to advise you better.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Aug 2023 09:36:29 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-08-15T09:36:29Z</dc:date>
    <item>
      <title>How to group XML request events</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-group-XML-request-events/m-p/654338#M11151</link>
      <description>&lt;P&gt;Hi Splunk Experts,&lt;/P&gt;&lt;P&gt;I've different XML request(100+ requests) as a multi-line event. Is it possible to stat these requests and get their count. But all these request would have any values between their tags and rex-ing all these request to stat them would be a difficult task, but is there any possible way to achieve this criteria. Any suggestion would be very much helpful!!. Thanks in advance!!&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 09:19:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-group-XML-request-events/m-p/654338#M11151</guid>
      <dc:creator>Thulasinathan_M</dc:creator>
      <dc:date>2023-08-15T09:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to group XML request events</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-group-XML-request-events/m-p/654343#M11152</link>
      <description>&lt;P&gt;You can use spath to extract fields from XML (as well as JSON).&lt;/P&gt;&lt;P&gt;Perhaps if you could share some anonymised events, we might be able to advise you better.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 09:36:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-group-XML-request-events/m-p/654343#M11152</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-15T09:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to group XML request events</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-group-XML-request-events/m-p/654346#M11153</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;!! Thanks for the assistance.&lt;BR /&gt;The Request 1 &amp;amp; Request 3 shares the same template, but the value passed in the tags are different, but I want to consider these two request as same, while using a stat command and expecting it to return count as '2' for request with books &amp;amp; genres as '1'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Request 1:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;catalog&amp;gt;
   &amp;lt;book id="bk101"&amp;gt;
      &amp;lt;author&amp;gt;Gambardella, Matthew&amp;lt;/author&amp;gt;
      &amp;lt;title&amp;gt;XML Developer's Guide&amp;lt;/title&amp;gt;
      &amp;lt;genre&amp;gt;Computer&amp;lt;/genre&amp;gt;
      &amp;lt;price&amp;gt;44.95&amp;lt;/price&amp;gt;
      &amp;lt;publish_date&amp;gt;2000-10-01&amp;lt;/publish_date&amp;gt;
      &amp;lt;description&amp;gt;An in-depth look at creating applications 
      with XML.&amp;lt;/description&amp;gt;
   &amp;lt;/book&amp;gt;
&amp;lt;/catalog&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Request 2:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;catalog&amp;gt;
   &amp;lt;genres code="gc101"&amp;gt;
      &amp;lt;genre&amp;gt;Romance&amp;lt;/genre&amp;gt;  
      &amp;lt;genre&amp;gt;Horror&amp;lt;/genre&amp;gt;     
      &amp;lt;genre&amp;gt;Science Fiction&amp;lt;/genre&amp;gt;  
   &amp;lt;/genres&amp;gt;
&amp;lt;/catalog&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Request 3:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;catalog&amp;gt;
   &amp;lt;book id="bk111"&amp;gt;
      &amp;lt;author&amp;gt;O'Brien, Tim&amp;lt;/author&amp;gt;
      &amp;lt;title&amp;gt;MSXML3: A Comprehensive Guide&amp;lt;/title&amp;gt;
      &amp;lt;genre&amp;gt;Computer&amp;lt;/genre&amp;gt;
      &amp;lt;price&amp;gt;36.95&amp;lt;/price&amp;gt;
      &amp;lt;publish_date&amp;gt;2000-12-01&amp;lt;/publish_date&amp;gt;
      &amp;lt;description&amp;gt;The Microsoft MSXML3 parser is covered in 
      detail, with attention to XML DOM interfaces, XSLT processing, 
      SAX and more.&amp;lt;/description&amp;gt;
   &amp;lt;/book&amp;gt;
&amp;lt;/catalog&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 09:48:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-group-XML-request-events/m-p/654346#M11153</guid>
      <dc:creator>Thulasinathan_M</dc:creator>
      <dc:date>2023-08-15T09:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to group XML request events</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-group-XML-request-events/m-p/654347#M11154</link>
      <description>&lt;P&gt;If you just want to count the first level keys within catalog, you could do this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "&amp;lt;catalog&amp;gt;\s+&amp;lt;(?&amp;lt;key&amp;gt;\w+)"
| stats count by key&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 15 Aug 2023 10:02:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-group-XML-request-events/m-p/654347#M11154</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-15T10:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to group XML request events</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-group-XML-request-events/m-p/654351#M11155</link>
      <description>&lt;P&gt;There are no such differentiates, just to make clear on requirement I shared the sample xml request. The only difference we can identify is based on complete template.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 10:28:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-group-XML-request-events/m-p/654351#M11155</guid>
      <dc:creator>Thulasinathan_M</dc:creator>
      <dc:date>2023-08-15T10:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to group XML request events</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-group-XML-request-events/m-p/654352#M11156</link>
      <description>&lt;P&gt;I am not sure I understand what you mean - here is a runanywhere example showing the extraction of the first level key from catalog and the stats count&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="&amp;lt;?xml version=\"1.0\"?&amp;gt;
&amp;lt;catalog&amp;gt;
   &amp;lt;book id=\"bk101\"&amp;gt;
      &amp;lt;author&amp;gt;Gambardella, Matthew&amp;lt;/author&amp;gt;
      &amp;lt;title&amp;gt;XML Developer's Guide&amp;lt;/title&amp;gt;
      &amp;lt;genre&amp;gt;Computer&amp;lt;/genre&amp;gt;
      &amp;lt;price&amp;gt;44.95&amp;lt;/price&amp;gt;
      &amp;lt;publish_date&amp;gt;2000-10-01&amp;lt;/publish_date&amp;gt;
      &amp;lt;description&amp;gt;An in-depth look at creating applications 
      with XML.&amp;lt;/description&amp;gt;
   &amp;lt;/book&amp;gt;
&amp;lt;/catalog&amp;gt;|&amp;lt;?xml version=\"1.0\"?&amp;gt;
&amp;lt;catalog&amp;gt;
   &amp;lt;genres code=\"gc101\"&amp;gt;
      &amp;lt;genre&amp;gt;Romance&amp;lt;/genre&amp;gt;  
      &amp;lt;genre&amp;gt;Horror&amp;lt;/genre&amp;gt;     
      &amp;lt;genre&amp;gt;Science Fiction&amp;lt;/genre&amp;gt;  
   &amp;lt;/genres&amp;gt;
&amp;lt;/catalog&amp;gt;|&amp;lt;?xml version=\"1.0\"?&amp;gt;
&amp;lt;catalog&amp;gt;
   &amp;lt;book id=\"bk111\"&amp;gt;
      &amp;lt;author&amp;gt;O'Brien, Tim&amp;lt;/author&amp;gt;
      &amp;lt;title&amp;gt;MSXML3: A Comprehensive Guide&amp;lt;/title&amp;gt;
      &amp;lt;genre&amp;gt;Computer&amp;lt;/genre&amp;gt;
      &amp;lt;price&amp;gt;36.95&amp;lt;/price&amp;gt;
      &amp;lt;publish_date&amp;gt;2000-12-01&amp;lt;/publish_date&amp;gt;
      &amp;lt;description&amp;gt;The Microsoft MSXML3 parser is covered in 
      detail, with attention to XML DOM interfaces, XSLT processing, 
      SAX and more.&amp;lt;/description&amp;gt;
   &amp;lt;/book&amp;gt;
&amp;lt;/catalog&amp;gt;"
| eval xml=split(_raw,"|")
| mvexpand xml
| table xml
| rex field=xml "&amp;lt;catalog&amp;gt;\s+&amp;lt;(?&amp;lt;key&amp;gt;\w+)"
| stats count by key&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 15 Aug 2023 10:44:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-group-XML-request-events/m-p/654352#M11156</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-15T10:44:48Z</dc:date>
    </item>
  </channel>
</rss>

