<?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: Can you help me count the values of two different fields? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Can-you-help-me-count-the-values-of-two-different-fields/m-p/436654#M7865</link>
    <description>&lt;P&gt;thanks a lot it s perfect&lt;/P&gt;</description>
    <pubDate>Thu, 18 Oct 2018 06:56:44 GMT</pubDate>
    <dc:creator>jip31</dc:creator>
    <dc:date>2018-10-18T06:56:44Z</dc:date>
    <item>
      <title>Can you help me count the values of two different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Can-you-help-me-count-the-values-of-two-different-fields/m-p/436651#M7862</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;I use the code below in order to count the number of hosts by OS and by build. But, it doesn't work.&lt;BR /&gt;
Could you help me please??&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=*
index="windows" sourcetype="wineventlog" 
SourceName="*" Type="Critique" OR Type="*"  

| dedup host   

| stats count by host   

| join host [search index=windows sourcetype=winregistry  key_path="\\registry\\machine\\software\\wow6432node\\x\\master\\WindowsVersion" 
 OR 
key_path="\\registry\\machine\\software\\microsoft\\windows nt\\currentversion\\ReleaseId"
 |eval OS=if(key_path=="\\registry\\machine\\software\\wow6432node\\x\\master\\WindowsVersion",data, null), 
Build=if(key_path=="\\registry\\machine\\software\\microsoft\\windows nt\\currentversion\\ReleaseId",data,null) 

| stats values(data) as OS by host]
| stats count values(host) by OS, Build

| rename count as Total
| table OS Build Total
| sort -Total limit=10
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Oct 2018 14:10:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Can-you-help-me-count-the-values-of-two-different-fields/m-p/436651#M7862</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2018-10-17T14:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me count the values of two different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Can-you-help-me-count-the-values-of-two-different-fields/m-p/436652#M7863</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=*
 index="windows" sourcetype="wineventlog"  SourceName="*" Type="Critique" OR Type="*"  
  | dedup host    
 | stats count by host  
 | append [search index=windows sourcetype=winregistry  key_path="\\registry\\machine\\software\\wow6432node\\x\\master\\WindowsVersion" 
  OR 
 key_path="\\registry\\machine\\software\\microsoft\\windows nt\\currentversion\\ReleaseId"
  |eval OS=if(key_path=="\\registry\\machine\\software\\wow6432node\\x\\master\\WindowsVersion",data, null), 
 Build=if(key_path=="\\registry\\machine\\software\\microsoft\\windows nt\\currentversion\\ReleaseId",data,null) 
 | stats latest(OS) as OS latest(Build) as Build by host ]
| stats values(OS) as OS values(Build) as Build by host
| stats count as Total by OS Build
 | sort -Total limit=10
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Oct 2018 14:25:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Can-you-help-me-count-the-values-of-two-different-fields/m-p/436652#M7863</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-10-17T14:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me count the values of two different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Can-you-help-me-count-the-values-of-two-different-fields/m-p/436653#M7864</link>
      <description>&lt;P&gt;i think &lt;BR /&gt;
&lt;CODE&gt;| stats count values(host) by OS, Build&lt;/CODE&gt;&lt;BR /&gt;
is wrong..&lt;/P&gt;

&lt;P&gt;try - &lt;BR /&gt;
&lt;CODE&gt;index=* | stats values(host) as HostCount by OS Build&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 14:34:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Can-you-help-me-count-the-values-of-two-different-fields/m-p/436653#M7864</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2018-10-17T14:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me count the values of two different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Can-you-help-me-count-the-values-of-two-different-fields/m-p/436654#M7865</link>
      <description>&lt;P&gt;thanks a lot it s perfect&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 06:56:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Can-you-help-me-count-the-values-of-two-different-fields/m-p/436654#M7865</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2018-10-18T06:56:44Z</dc:date>
    </item>
  </channel>
</rss>

