<?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: Search uniq into array, new search Where uniq array into another search to get percentage in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-uniq-into-array-new-search-Where-uniq-array-into-another/m-p/501990#M140560</link>
    <description>&lt;P&gt;Followed: &lt;A href="https://answers.splunk.com/answers/438609/calculate-sum-of-multiple-fields-in-different-line.html"&gt;https://answers.splunk.com/answers/438609/calculate-sum-of-multiple-fields-in-different-line.html&lt;/A&gt;&lt;BR /&gt;
This gives me good starting point and I get search to search what I need with good results. &lt;/P&gt;</description>
    <pubDate>Sat, 28 Mar 2020 16:50:02 GMT</pubDate>
    <dc:creator>jbanhome</dc:creator>
    <dc:date>2020-03-28T16:50:02Z</dc:date>
    <item>
      <title>Search uniq into array, new search Where uniq array into another search to get percentage</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-uniq-into-array-new-search-Where-uniq-array-into-another/m-p/501989#M140559</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Can you please point me into right direction or already answered good topic about one Splunk search where I have indexed.&lt;/P&gt;
&lt;P&gt;Example data:&lt;BR /&gt;Value, Passed&lt;BR /&gt;Yo, Yes&lt;BR /&gt;Yo, Yes&lt;BR /&gt;Yo, No&lt;BR /&gt;Bro, No&lt;BR /&gt;Bro, Yes&lt;/P&gt;
&lt;P&gt;Now I want first to dedup (or get unique vaules into array -&amp;gt; Yo and Bro)&lt;BR /&gt;and then get chart results in percentages like&lt;BR /&gt;Yo 75% Yes, 25% No&lt;BR /&gt;Bro 50% Yes, 50% No.&lt;/P&gt;
&lt;P&gt;And probably put in into Chart where X axis will be Yo, Bro, .... and Y axis percentage in 2 colors. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2020 22:59:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-uniq-into-array-new-search-Where-uniq-array-into-another/m-p/501989#M140559</guid>
      <dc:creator>jbanhome</dc:creator>
      <dc:date>2020-06-08T22:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Search uniq into array, new search Where uniq array into another search to get percentage</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-uniq-into-array-new-search-Where-uniq-array-into-another/m-p/501990#M140560</link>
      <description>&lt;P&gt;Followed: &lt;A href="https://answers.splunk.com/answers/438609/calculate-sum-of-multiple-fields-in-different-line.html"&gt;https://answers.splunk.com/answers/438609/calculate-sum-of-multiple-fields-in-different-line.html&lt;/A&gt;&lt;BR /&gt;
This gives me good starting point and I get search to search what I need with good results. &lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2020 16:50:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-uniq-into-array-new-search-Where-uniq-array-into-another/m-p/501990#M140560</guid>
      <dc:creator>jbanhome</dc:creator>
      <dc:date>2020-03-28T16:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: Search uniq into array, new search Where uniq array into another search to get percentage</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-uniq-into-array-new-search-Where-uniq-array-into-another/m-p/501991#M140561</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;|makeresults
| eval _raw="Value, Passed
Yo, Yes
Yo, Yes
Yo, No
Bro, No
Bro, Yes"
| multikv forceheader=1
| table Value, Passed
| foreach * [ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = trim('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;')]
| rename COMMENT as "This is your sample, From here, the logic"
| stats count as Total count(eval(Passed="Yes")) as Yes count(eval(Passed="No")) as No by Value
| eval Yes = Yes / Total * 100, No = No / Total * 100
| fields - Total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This query makes chart from table.&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="table"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8593iC6038FCE83845225/image-size/large?v=v2&amp;amp;px=999" role="button" title="table" alt="table" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;If you use &lt;CODE&gt;stats&lt;/CODE&gt; early ,you can make better query.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2020 22:56:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-uniq-into-array-new-search-Where-uniq-array-into-another/m-p/501991#M140561</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-03-28T22:56:33Z</dc:date>
    </item>
  </channel>
</rss>

