<?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 How to group results from two rex together into one Column Chart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-results-from-two-rex-together-into-one-Column-Chart/m-p/370199#M165175</link>
    <description>&lt;P&gt;I am doing a search query where there will be a dynamic client ID with either a success or a failure result code --  I want to look at all the successes and failures based on a client ID. &lt;/P&gt;

&lt;P&gt;The client ID always comes after the method name, a comma, the code (for success or failure), a space and comma, then the client ID followed by a comma. This is an example of what the event logs look like: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;A bunch of random logging stuff&amp;gt; ~aStaticMethodName,SuccessOrFailureCode5555 ,ClientID, &amp;lt;Another bunch of random logging stuff&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am using 'rex' to find the Client IDs for both the successes or failures by client ID like this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"My Search Here" 
| rex "~myMethod,successCode0000 ,(?&amp;lt;success&amp;gt;[^,]+)," 
| rex "~myMethod,failureCode1111 ,(?&amp;lt;failure&amp;gt;[^,]+),"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I then add a &lt;CODE&gt;| chart count by success&lt;/CODE&gt; (or change the success to failure) and can get an output looking like this:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3857iA16DAB3BD4D79758/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;The successes and failures will have common client IDs (client A, client B, etc). &lt;/P&gt;

&lt;P&gt;What I want to do, is combine both success and failure into one chart grouped by client ID like this:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3858i19AE7B4173DA7403/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Is there a way to do this in Splunk? Help is greatly appreciated!&lt;/P&gt;</description>
    <pubDate>Tue, 14 Nov 2017 20:32:54 GMT</pubDate>
    <dc:creator>lordhans</dc:creator>
    <dc:date>2017-11-14T20:32:54Z</dc:date>
    <item>
      <title>How to group results from two rex together into one Column Chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-results-from-two-rex-together-into-one-Column-Chart/m-p/370199#M165175</link>
      <description>&lt;P&gt;I am doing a search query where there will be a dynamic client ID with either a success or a failure result code --  I want to look at all the successes and failures based on a client ID. &lt;/P&gt;

&lt;P&gt;The client ID always comes after the method name, a comma, the code (for success or failure), a space and comma, then the client ID followed by a comma. This is an example of what the event logs look like: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;A bunch of random logging stuff&amp;gt; ~aStaticMethodName,SuccessOrFailureCode5555 ,ClientID, &amp;lt;Another bunch of random logging stuff&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am using 'rex' to find the Client IDs for both the successes or failures by client ID like this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"My Search Here" 
| rex "~myMethod,successCode0000 ,(?&amp;lt;success&amp;gt;[^,]+)," 
| rex "~myMethod,failureCode1111 ,(?&amp;lt;failure&amp;gt;[^,]+),"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I then add a &lt;CODE&gt;| chart count by success&lt;/CODE&gt; (or change the success to failure) and can get an output looking like this:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3857iA16DAB3BD4D79758/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;The successes and failures will have common client IDs (client A, client B, etc). &lt;/P&gt;

&lt;P&gt;What I want to do, is combine both success and failure into one chart grouped by client ID like this:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3858i19AE7B4173DA7403/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Is there a way to do this in Splunk? Help is greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 20:32:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-results-from-two-rex-together-into-one-Column-Chart/m-p/370199#M165175</guid>
      <dc:creator>lordhans</dc:creator>
      <dc:date>2017-11-14T20:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to group results from two rex together into one Column Chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-results-from-two-rex-together-into-one-Column-Chart/m-p/370200#M165176</link>
      <description>&lt;P&gt;try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"My Search Here" 
 | rex "~myMethod,successCode0000 ,(?&amp;lt;success&amp;gt;[^,]+)," 
 | rex "~myMethod,failureCode1111 ,(?&amp;lt;failure&amp;gt;[^,]+)," 
 | eval clients=coalesce(success,failure)
 | stats count(success) as success count(failure) as failure by clients
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Nov 2017 20:40:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-results-from-two-rex-together-into-one-Column-Chart/m-p/370200#M165176</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-11-14T20:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to group results from two rex together into one Column Chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-results-from-two-rex-together-into-one-Column-Chart/m-p/370201#M165177</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"My Search Here" 
 | rex "~myMethod,(?&amp;lt;status&amp;gt;[^,]+) ,(?&amp;lt;clientID&amp;gt;[^,]+)," 
 | replace "successCode0000" with "Success" "failureCode1111" with "Failure" in status
| chart count over clientID by status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Nov 2017 20:40:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-results-from-two-rex-together-into-one-Column-Chart/m-p/370201#M165177</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-11-14T20:40:48Z</dc:date>
    </item>
  </channel>
</rss>

