<?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: Why am I not getting a result? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374074#M45372</link>
    <description>&lt;P&gt;Still nothing man. It brings the Total but that's it.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Mar 2018 19:45:11 GMT</pubDate>
    <dc:creator>albinortiz</dc:creator>
    <dc:date>2018-03-23T19:45:11Z</dc:date>
    <item>
      <title>Why am I not getting a result?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374067#M45365</link>
      <description>&lt;P&gt;The following code is intended to do several things. First, I am looking for all the hosts that are producing winevents and counting them.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=winevents | dedup host| stats count as Total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Next, I do an ldapsearch for all computers in AD that have a Windows OS.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| append [ldapsearch search="(objectClass=computer)" attrs="cn,operatingSystem,operatingSystemVersion"
| lookup dnslookup clienthost AS cn
| search (opeartingSystem="Win*")]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Finally, I count those Windows computers and calculate a percentage between the Total computers and the Windows Computers&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count as WindowsComputers | append [makeresults [eval var = Total/WindowsComputers)]] | table var
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The variable var is not displaying the percentage or anything whatsoever. Any ideas? this is the full code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=winevents 
| dedup host
| stats count as Total
| append [ldapsearch search="(objectClass=computer)" attrs="cn,operatingSystem,operatingSystemVersion"
| lookup dnslookup clienthost AS cn
| search (opeartingSystem="Win*")]
| stats count as WindowsComputers 
| append [makeresults [eval var = Total/WindowsComputers)]] 
| table var
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 15:50:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374067#M45365</guid>
      <dc:creator>albinortiz</dc:creator>
      <dc:date>2018-03-23T15:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not getting a result?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374068#M45366</link>
      <description>&lt;P&gt;Line 8 should read | append [makeresults [eval var = Total/WindowsComputers)*100,1]] &lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 15:55:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374068#M45366</guid>
      <dc:creator>albinortiz</dc:creator>
      <dc:date>2018-03-23T15:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not getting a result?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374069#M45367</link>
      <description>&lt;P&gt;Hey &lt;/P&gt;

&lt;P&gt;First thing I'd change is the first query to &lt;CODE&gt;index=winevents | stats dc(host) as Total&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;But coming to your issue, if your search is like this, after the makeresults you have a "[" and you must have a "|"&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 16:01:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374069#M45367</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-23T16:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not getting a result?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374070#M45368</link>
      <description>&lt;P&gt;If I use index=winevents | stats dc(host) as Total, for some reason it won't bring the real amount.&lt;/P&gt;

&lt;P&gt;I tried changing the syntax and nothing yet.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 17:01:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374070#M45368</guid>
      <dc:creator>albinortiz</dc:creator>
      <dc:date>2018-03-23T17:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not getting a result?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374071#M45369</link>
      <description>&lt;P&gt;Can you try this by parts?&lt;/P&gt;

&lt;P&gt;Is this returning events?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=winevents 
 | dedup host
 | stats count as Total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this returning events?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=winevents 
 | dedup host
 | stats count as Total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this returning events?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ldapsearch search="(objectClass=computer)" attrs="cn,operatingSystem,operatingSystemVersion"
 | lookup dnslookup clienthost AS cn
 | search (opeartingSystem="Win*")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And finally, have you changed to &lt;STRONG&gt;| append [ makeresults | eval var = Total/WindowsComputers) ]&lt;/STRONG&gt;  ??&lt;/P&gt;

&lt;P&gt;Notice that | append [makeresults [eval var = Total/WindowsComputers)]]  will never return results because it is a separate search that has no knowledge of the variables Total or WindowsComputers&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 17:37:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374071#M45369</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-23T17:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not getting a result?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374072#M45370</link>
      <description>&lt;P&gt;@tiagofbmm Both queries return events. I use both on a different dashboard which works.&lt;/P&gt;

&lt;P&gt;| append [ makeresults | eval var = Total/WindowsComputers) ] - No results found&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 17:55:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374072#M45370</guid>
      <dc:creator>albinortiz</dc:creator>
      <dc:date>2018-03-23T17:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not getting a result?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374073#M45371</link>
      <description>&lt;P&gt;Cool so as I told you, the last append has no knowledge of what the remaining things, mainly because the subsearches are run before the main search!&lt;/P&gt;

&lt;P&gt;I believe what you need is this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=winevents 
 | dedup host
 | stats count as Total
 | appendcols [ldapsearch search="(objectClass=computer)" attrs="cn,operatingSystem,operatingSystemVersion"
 | lookup dnslookup clienthost AS cn
 | search (opeartingSystem="Win*")  | stats count as WindowsComputers ]
 | eval Percentage=Total/WindowsComputers
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Mar 2018 18:04:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374073#M45371</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-23T18:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not getting a result?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374074#M45372</link>
      <description>&lt;P&gt;Still nothing man. It brings the Total but that's it.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 19:45:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374074#M45372</guid>
      <dc:creator>albinortiz</dc:creator>
      <dc:date>2018-03-23T19:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not getting a result?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374075#M45373</link>
      <description>&lt;P&gt;This returns result?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| ldapsearch search="(objectClass=computer)" attrs="cn,operatingSystem,operatingSystemVersion"
  | lookup dnslookup clienthost AS cn
  | search (opeartingSystem="Win*")  | stats count as WindowsComputers
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Mar 2018 19:51:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374075#M45373</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-23T19:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not getting a result?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374076#M45374</link>
      <description>&lt;P&gt;Yep. I have 900 computers in my network and it brings all 900&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 20:07:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374076#M45374</guid>
      <dc:creator>albinortiz</dc:creator>
      <dc:date>2018-03-23T20:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not getting a result?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374077#M45375</link>
      <description>&lt;P&gt;Hopefully not a stupid question at this time but... did you have the | in the ldapsearch?&lt;/P&gt;

&lt;P&gt;index=winevents &lt;BR /&gt;
  | dedup host&lt;BR /&gt;
  | stats count as Total&lt;BR /&gt;
  | appendcols [ | ldapsearch search="(objectClass=computer)" attrs="cn,operatingSystem,operatingSystemVersion"&lt;BR /&gt;
  | lookup dnslookup clienthost AS cn&lt;BR /&gt;
  | search (opeartingSystem="Win*")  | stats count as WindowsComputers ]&lt;BR /&gt;
  | eval Percentage=Total/WindowsComputers&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 20:32:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374077#M45375</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-23T20:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not getting a result?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374078#M45376</link>
      <description>&lt;P&gt;Please let me know if the answer was useful for you. If it was, accept it and upvote. If not, give us more input so we can help you with that&lt;/P&gt;</description>
      <pubDate>Sat, 24 Mar 2018 07:09:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374078#M45376</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-24T07:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not getting a result?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374079#M45377</link>
      <description>&lt;P&gt;I will get back to you Monday. Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 24 Mar 2018 07:29:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374079#M45377</guid>
      <dc:creator>albinortiz</dc:creator>
      <dc:date>2018-03-24T07:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not getting a result?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374080#M45378</link>
      <description>&lt;P&gt;I had the | in the ldapsearch but was missing the [.&lt;/P&gt;

&lt;P&gt;Thanks for all the help!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 13:20:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Why-am-I-not-getting-a-result/m-p/374080#M45378</guid>
      <dc:creator>albinortiz</dc:creator>
      <dc:date>2018-03-26T13:20:43Z</dc:date>
    </item>
  </channel>
</rss>

