<?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 extract total count for different fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-total-count-for-different-fields/m-p/172465#M49417</link>
    <description>&lt;P&gt;Data_no: 1T&lt;BR /&gt;
Identity: A&lt;BR /&gt;
Data_no: 2T&lt;BR /&gt;
Identity: C&lt;/P&gt;

&lt;P&gt;This is how your data is? If answer is no then can you post  some sample log lines.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 17:16:27 GMT</pubDate>
    <dc:creator>strive</dc:creator>
    <dc:date>2020-09-28T17:16:27Z</dc:date>
    <item>
      <title>how to extract total count for different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-total-count-for-different-fields/m-p/172464#M49416</link>
      <description>&lt;P&gt;Hi, i will like to extract the count for the following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Data_no: 1T    
Identity: A  
Data_no: 2T  
Identity: C
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i tried the following   &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex max_match= 0 "(?m) Data_no: (?&amp;lt;DataNo&amp;gt;[a-zA-Z0-9#]+)"  
| rex max_match= 0 "(?m) Identity: (?&amp;lt;Identity&amp;gt;[a-zA-Z0-9#]+)"   
| stats count(eval(Identity= "A")) as A, count(eval(Identity= "C")) as C by DataNo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The table returns the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;DataNO| A | C  
1T    | 1 | 1  
2T    | 1 | 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How to i filter it so that it will become like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;DataNO| A | C  
1T    | 1 | 0  
2T    | 0 | 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2014 03:33:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-total-count-for-different-fields/m-p/172464#M49416</guid>
      <dc:creator>wkau</dc:creator>
      <dc:date>2014-08-06T03:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract total count for different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-total-count-for-different-fields/m-p/172465#M49417</link>
      <description>&lt;P&gt;Data_no: 1T&lt;BR /&gt;
Identity: A&lt;BR /&gt;
Data_no: 2T&lt;BR /&gt;
Identity: C&lt;/P&gt;

&lt;P&gt;This is how your data is? If answer is no then can you post  some sample log lines.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:16:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-total-count-for-different-fields/m-p/172465#M49417</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2020-09-28T17:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract total count for different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-total-count-for-different-fields/m-p/172466#M49418</link>
      <description>&lt;P&gt;yup this is an example of how my data is!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2014 05:54:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-total-count-for-different-fields/m-p/172466#M49418</guid>
      <dc:creator>wkau</dc:creator>
      <dc:date>2014-08-06T05:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract total count for different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-total-count-for-different-fields/m-p/172467#M49419</link>
      <description>&lt;P&gt;try this&lt;BR /&gt;
|chart count by datano identity&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2014 07:35:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-total-count-for-different-fields/m-p/172467#M49419</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2014-08-06T07:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract total count for different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-total-count-for-different-fields/m-p/172468#M49420</link>
      <description>&lt;P&gt;after trying that i got A=1, C=1 for 1T and A=1, C=1 for 2T. i will need something like A=1,C=0 for 1T and A=0, C=1 for 2T&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2014 08:03:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-total-count-for-different-fields/m-p/172468#M49420</guid>
      <dc:creator>wkau</dc:creator>
      <dc:date>2014-08-06T08:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract total count for different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-total-count-for-different-fields/m-p/172469#M49421</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Updated&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search| rex max_match= 0 "(?m) Data_no: (?&amp;lt;DataNo&amp;gt;[a-zA-Z0-9#]+)"  
| rex max_match= 0 "(?m) Identity: (?&amp;lt;Identity&amp;gt;[a-zA-Z0-9#]+)" | eval temp=mvzip (DataNo, Identity) | mvexpand temp | rex field=temp "(?&amp;lt;DataNo&amp;gt;.*) (?&amp;lt;Identity&amp;gt;.*)"
| chart count over DataNo by Identity
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Aug 2014 13:05:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-total-count-for-different-fields/m-p/172469#M49421</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-06T13:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract total count for different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-total-count-for-different-fields/m-p/172470#M49422</link>
      <description>&lt;P&gt;I still got back the same results  the data that is provided happens in the same event at the same time, is it possible to filter the DataNO and Identity individually so that it does not double count?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2014 01:06:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-total-count-for-different-fields/m-p/172470#M49422</guid>
      <dc:creator>wkau</dc:creator>
      <dc:date>2014-08-07T01:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract total count for different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-total-count-for-different-fields/m-p/172471#M49423</link>
      <description>&lt;P&gt;Try updated answer.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2014 03:43:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-total-count-for-different-fields/m-p/172471#M49423</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-07T03:43:16Z</dc:date>
    </item>
  </channel>
</rss>

