<?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 fetch the count with details. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-count-with-details/m-p/683535#M233393</link>
    <description>&lt;P&gt;If I understand correctly, you have two different log types ABC and EFG in the same index, and you want to count how many success, fail, and error events occur, but only for correlation IDs that occur in both ABC and EFG?&lt;/P&gt;&lt;P&gt;Assuming the field names are correct, your current query should work to count success, fail, and error events from both, though it will count events that only occur in one of the two types.&lt;/P&gt;&lt;P&gt;It is not clear how you would like the details (json_ext of message) to be displayed with the count of success, fail, and error events. You could do stats ... by json_ext to see the counts by json_ext, but this would only be practical if the json_ext messages are not very different.&lt;/P&gt;</description>
    <pubDate>Sun, 07 Apr 2024 20:43:27 GMT</pubDate>
    <dc:creator>marnall</dc:creator>
    <dc:date>2024-04-07T20:43:27Z</dc:date>
    <item>
      <title>How to fetch the count with details.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-count-with-details/m-p/683435#M233371</link>
      <description>&lt;P class="lia-align-justify"&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have one log that is ABC and it is present in sl-sfdc api and have another log EFG that is present in sl-gcdm api now I want to see the properties and error code fields which is present in EFG log but it has many other logs coming from different apis also . I only want the log which is having the correlationId same in ABC then it should check the other log .And then I will use this regular expression to get the fields, like spath.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Currently I am using this query&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=whcrm (

    sourcetype=xl-sfdcapi ("Create / Update Consents for gcid" OR "Failure while Create / Update Consents for gcid" OR "Create / Update Consents done")

) OR (

    sourcetype=sl-gcdm-api ("Error in sync-consent-dataFlow:")

)

| rename properties.correlationId as correlationId

| rex field=_raw "correlationId: (?&amp;lt;correlationId&amp;gt;[^\s]+)"

| eval is_success=if(match(_raw, "Create / Update Consents done"), 1, 0)

| eval is_failed=if(match(_raw, "Failure while Create / Update Consents for gcid"), 1, 0)

| eval is_error=if(match(_raw, "Error in sync-consent-dataFlow:"), 1, 0)

| stats sum(is_success) as Success_Count, sum(is_failed) as Failed_Count,

| eval Total_Consents = Success_Count + Failed_Count

| table Total_Consents, Success_Count, Failed_Count&lt;/LI-CODE&gt;
&lt;P class=""&gt;first one is the ABC log and second is the EFG also I want to use this regular expression in between to get the details&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| rex field=message "(?&amp;lt;json_ext&amp;gt;\{[\w\W]*\})"

    | spath input=json_ext&lt;/LI-CODE&gt;
&lt;P class=""&gt;&lt;BR /&gt;Or there can be any other way to write the query and get the counts please help .&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 15:56:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-count-with-details/m-p/683435#M233371</guid>
      <dc:creator>avii7326</dc:creator>
      <dc:date>2024-04-05T15:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch the count with details.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-count-with-details/m-p/683535#M233393</link>
      <description>&lt;P&gt;If I understand correctly, you have two different log types ABC and EFG in the same index, and you want to count how many success, fail, and error events occur, but only for correlation IDs that occur in both ABC and EFG?&lt;/P&gt;&lt;P&gt;Assuming the field names are correct, your current query should work to count success, fail, and error events from both, though it will count events that only occur in one of the two types.&lt;/P&gt;&lt;P&gt;It is not clear how you would like the details (json_ext of message) to be displayed with the count of success, fail, and error events. You could do stats ... by json_ext to see the counts by json_ext, but this would only be practical if the json_ext messages are not very different.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2024 20:43:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-count-with-details/m-p/683535#M233393</guid>
      <dc:creator>marnall</dc:creator>
      <dc:date>2024-04-07T20:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch the count with details.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-count-with-details/m-p/683562#M233400</link>
      <description>&lt;P&gt;Yes you&amp;nbsp; understand correctly, I have two different log types ABC and EFG in the same index, but the sourcetype is different in both logs so the condition is when there will be error it will be calculated from the ABC log but the details which it is containing it is in EFG log that is in other sourcetype and I will also fetch the details of that log but what I want is when I got total error is ABC is 5 then when I should search the ABC and EFG together it should show me 5 errors only related to the correlationid.&lt;BR /&gt;&lt;BR /&gt;I hope you understand my query from this .&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 07:27:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-count-with-details/m-p/683562#M233400</guid>
      <dc:creator>avi7326</dc:creator>
      <dc:date>2024-04-08T07:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch the count with details.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-count-with-details/m-p/683563#M233401</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;Can I please get you guidance.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 08:19:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-count-with-details/m-p/683563#M233401</guid>
      <dc:creator>avi7326</dc:creator>
      <dc:date>2024-04-08T08:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to fetch the count with details.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-count-with-details/m-p/683634#M233425</link>
      <description>&lt;P&gt;So if there is an error seen in the ABC log, then you would like to find the details for that error in the EFG log. You would like to count the number of errors for each correlationId, so that you can later search for that correlation Id and list all of the errors that occurred along with the details message for that correlationId. Is that correct?&lt;/P&gt;&lt;P&gt;E.g.:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;&lt;P&gt;CorrelationId&lt;/P&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;Errors&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;Details&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;abcd-0001&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;0&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;abcd-0002&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;4&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;P&gt;Error msg 1&lt;/P&gt;&lt;P&gt;Error msg 2&lt;/P&gt;&lt;P&gt;Error msg 3&lt;/P&gt;&lt;P&gt;Error msg 4&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;abcd-0003&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;1&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;Error msg 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;abcd-0004&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;2&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;P&gt;Error msg 1&lt;/P&gt;&lt;P&gt;Error msg 2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 18:44:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fetch-the-count-with-details/m-p/683634#M233425</guid>
      <dc:creator>marnall</dc:creator>
      <dc:date>2024-04-08T18:44:52Z</dc:date>
    </item>
  </channel>
</rss>

