<?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: question on search query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/question-on-search-query/m-p/312198#M93518</link>
    <description>&lt;P&gt;This isn't exactly what you asked for but it is better (and you can modify it to suit if you really would like):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval raw="1 No 111
1 Yes 10"
| makemv delim="
" raw
| mvexpand raw
| rex field=raw "^(?&amp;lt;Agency&amp;gt;\S+)\s+(?&amp;lt;Clicked_Link&amp;gt;\S+)\s+(?&amp;lt;count&amp;gt;.*)$"
| fields - _time raw

| rename COMMENT AS "Everything above fakes sample data; everything below is your solution"

| eval {Clicked_Link}=count
| stats first(Yes) AS Yes first(No) AS No BY Agency
| eval Total = Yes + No
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 25 May 2017 21:07:18 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-05-25T21:07:18Z</dc:date>
    <item>
      <title>question on search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/question-on-search-query/m-p/312197#M93517</link>
      <description>&lt;P&gt;Looking for a single result that includes both values of clicked link then added up in a total column&lt;/P&gt;

&lt;P&gt;search... | eval clicked=if("Clicked Link"="Yes",1,0), &lt;BR /&gt;
notclicked=if("Clicked Link"="No",0,1)  | stats  count by Agency, "Clicked Link"&lt;/P&gt;

&lt;P&gt;generates this result&lt;/P&gt;

&lt;P&gt;Agency  Clicked Link        count&lt;BR /&gt;&lt;BR /&gt;
1           No                  111&lt;BR /&gt;
1           Yes                     10 &lt;/P&gt;

&lt;P&gt;What id like is a results that looks like this&lt;/P&gt;

&lt;P&gt;Agency  Clicked Link    Count   Clicked Link    count   Total&lt;BR /&gt;
1            No                 10         Yes              111         121&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 20:44:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/question-on-search-query/m-p/312197#M93517</guid>
      <dc:creator>roayers</dc:creator>
      <dc:date>2017-05-25T20:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: question on search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/question-on-search-query/m-p/312198#M93518</link>
      <description>&lt;P&gt;This isn't exactly what you asked for but it is better (and you can modify it to suit if you really would like):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval raw="1 No 111
1 Yes 10"
| makemv delim="
" raw
| mvexpand raw
| rex field=raw "^(?&amp;lt;Agency&amp;gt;\S+)\s+(?&amp;lt;Clicked_Link&amp;gt;\S+)\s+(?&amp;lt;count&amp;gt;.*)$"
| fields - _time raw

| rename COMMENT AS "Everything above fakes sample data; everything below is your solution"

| eval {Clicked_Link}=count
| stats first(Yes) AS Yes first(No) AS No BY Agency
| eval Total = Yes + No
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 May 2017 21:07:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/question-on-search-query/m-p/312198#M93518</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-25T21:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: question on search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/question-on-search-query/m-p/312199#M93519</link>
      <description>&lt;P&gt;that generates a  makeresults results error&lt;/P&gt;

&lt;P&gt;There are about 100 agencies in the query each has a "Clicked Result" of Yes and a "Clicked Result" of No which should be totaled here is the whole search that i'm starting with, hope this will help&lt;/P&gt;

&lt;P&gt;index="testing" * | lookup 1.csv email as Email output type as type one_id two_name one_two_three completion  | search one_two_name="*" | rename one_two_three as Agency | eval clicked=if("Clicked Link"="Yes",1,0), &lt;BR /&gt;
notclicked=if("Clicked Link"="No",0,1)  | stats  count by "Clicked Link"| addcoltotals count as Total&lt;/P&gt;

&lt;P&gt;gets this result&lt;/P&gt;

&lt;P&gt;"Clicked Link"      count&lt;BR /&gt;&lt;BR /&gt;
No                                   644&lt;BR /&gt;
Yes                                  93&lt;BR /&gt;
                                   737 &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:12:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/question-on-search-query/m-p/312199#M93519</guid>
      <dc:creator>roayers</dc:creator>
      <dc:date>2020-09-29T14:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: question on search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/question-on-search-query/m-p/312200#M93520</link>
      <description>&lt;P&gt;Change lines 2-5 to this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval raw="1 No 111::1 Yes 10"
| makemv delim="::" raw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 May 2017 22:42:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/question-on-search-query/m-p/312200#M93520</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-25T22:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: question on search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/question-on-search-query/m-p/312201#M93521</link>
      <description>&lt;P&gt;Your query works without my search, when I incorporate it in the results do not include counts for Yes No or &lt;BR /&gt;
Total&lt;/P&gt;

&lt;P&gt;Thanks for all of your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 04:39:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/question-on-search-query/m-p/312201#M93521</guid>
      <dc:creator>roayers</dc:creator>
      <dc:date>2017-05-26T04:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: question on search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/question-on-search-query/m-p/312202#M93522</link>
      <description>&lt;P&gt;Perhaps "Yes" is "YES" or "No" is "NO" or somehow do not exactly match.  As you noted, my solution works for the data that you gave in the question.  I cannot give a better answer without you giving me better sample data.&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 16:22:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/question-on-search-query/m-p/312202#M93522</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-26T16:22:58Z</dc:date>
    </item>
  </channel>
</rss>

