<?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 add 2 different fields with under the same function? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-2-different-fields-with-under-the-same-function/m-p/340714#M101041</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;I need to do add enter 2 different fields under the same function. The first is with an ACResponse specific and i need to respect this function because I will take more information I want just different ACReponse 200&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats list(ACResponse) as ACResponse by OCId 
| search ACResponse!="*200*"
|eval ACResponse=mvjoin(ACResponse,";")
| stats count(ACResponse) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But i need to research too result &lt;CODE&gt;Workflow="debordement_*"&lt;/CODE&gt;, ACresponse for debordement doesn't exist (null) and add to the first result :&lt;BR /&gt;
search:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Workflow="debordement_*" 
               |stats dc(OCId)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried with that but the result is null .. Can you tell me what is wrong please and help me if you know how.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  Workflow="*tsr*" OR "go_choix_1*"  
|stats count(OCId) 
| where Workflow="debordement_*" 
[| stats list(ACResponse) as ACResponse by OCId | search ACResponse!="*200*"|eval ACResponse=mvjoin(ACResponse,";")| stats count(ACResponse) as ACResponse]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks for your answers.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Mar 2017 16:33:11 GMT</pubDate>
    <dc:creator>Abarny</dc:creator>
    <dc:date>2017-03-06T16:33:11Z</dc:date>
    <item>
      <title>How to add 2 different fields with under the same function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-2-different-fields-with-under-the-same-function/m-p/340714#M101041</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;I need to do add enter 2 different fields under the same function. The first is with an ACResponse specific and i need to respect this function because I will take more information I want just different ACReponse 200&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats list(ACResponse) as ACResponse by OCId 
| search ACResponse!="*200*"
|eval ACResponse=mvjoin(ACResponse,";")
| stats count(ACResponse) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But i need to research too result &lt;CODE&gt;Workflow="debordement_*"&lt;/CODE&gt;, ACresponse for debordement doesn't exist (null) and add to the first result :&lt;BR /&gt;
search:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Workflow="debordement_*" 
               |stats dc(OCId)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried with that but the result is null .. Can you tell me what is wrong please and help me if you know how.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  Workflow="*tsr*" OR "go_choix_1*"  
|stats count(OCId) 
| where Workflow="debordement_*" 
[| stats list(ACResponse) as ACResponse by OCId | search ACResponse!="*200*"|eval ACResponse=mvjoin(ACResponse,";")| stats count(ACResponse) as ACResponse]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks for your answers.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 16:33:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-2-different-fields-with-under-the-same-function/m-p/340714#M101041</guid>
      <dc:creator>Abarny</dc:creator>
      <dc:date>2017-03-06T16:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 2 different fields with under the same function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-2-different-fields-with-under-the-same-function/m-p/340715#M101042</link>
      <description>&lt;P&gt;Alright... I THINK I understand what you're trying to do. Maybe.&lt;/P&gt;

&lt;P&gt;I think you're trying to join two searches based on a common field.&lt;/P&gt;

&lt;P&gt;If that's the case, try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YourSearch Workflow="*tsr*" OR "go_choix_1*" 
| eval ACResponse=mvjoin(ACResponse,";") 
| search ACResponse!="*200*" 
| join OCId type=outer 
    [ AnotherSearch Workflow="debordement_*" 
    | stats count by OCId] 
| stats list(ACResponse) AS ACResponse, dc(ACResponse) AS ACResponse_dcount by OCId
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You're doing a few different things with the stats functions in your searches, so I'm not sure exactly what your expected output is. You might need to explain a little more. Otherwise, I hope that helps.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 18:06:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-2-different-fields-with-under-the-same-function/m-p/340715#M101042</guid>
      <dc:creator>adayton20</dc:creator>
      <dc:date>2017-03-06T18:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 2 different fields with under the same function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-2-different-fields-with-under-the-same-function/m-p/340716#M101043</link>
      <description>&lt;P&gt;Yes, I want add this 2 differents search for give a  unique number. Currently I can find every two but regardless and I want regroup for have A + B.&lt;/P&gt;

&lt;P&gt;I try with your solution but I find only responses different of 200 and not the call by the Workflow "debordement_*"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1.      MySearch Workflow="*tsr*" OR "go_choix_1*" 
2.  | stats list(ACResponse) as ACResponse by OCId
3.   | search ACResponse!="*200*" 
4.   | eval ACResponse=mvjoin(ACResponse,";")
5.   | join OCId type=outer  [ search Workflow="debordement_*" 
6.   | stats count by OCId] 
7.   | stats list(ACResponse) AS ACResponse, dc(ACResponse) AS ACResponse_dcount by OCId
8.   | stats count(ACResponse_dcount ) 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Mar 2017 19:42:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-2-different-fields-with-under-the-same-function/m-p/340716#M101043</guid>
      <dc:creator>Abarny</dc:creator>
      <dc:date>2017-03-06T19:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 2 different fields with under the same function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-2-different-fields-with-under-the-same-function/m-p/340717#M101044</link>
      <description>&lt;P&gt;Right now your search is doing nothing but counting the unique values of &lt;CODE&gt;OCId&lt;/CODE&gt; which can be done like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats dc(OCId)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Mar 2017 20:51:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-2-different-fields-with-under-the-same-function/m-p/340717#M101044</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-24T20:51:23Z</dc:date>
    </item>
  </channel>
</rss>

