<?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: Failed eval command from sub search numerical results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Failed-eval-command-from-sub-search-numerical-results-Any/m-p/602544#M209743</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;if you are using the same time period for both user and devices you can try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="test" earliest=-2d@d latest=-1d@d
| stats dc(User) as User_count dc(SerialNumber) as Device_count
| eval perc=round(User_count/Device_count*100, 2)."%"&lt;/LI-CODE&gt;&lt;P&gt;In SPL you should almost always replace join, append* with stats. There are lot of presentation what to do it e.g. &amp;nbsp;&lt;A href="https://conf.splunk.com/watch/conf-online.html?search=%22Nick%20Mealy%22#/" target="_blank"&gt;https://conf.splunk.com/watch/conf-online.html?search=%22Nick%20Mealy%22#/&lt;/A&gt;&amp;nbsp;are links to Nick's "yearly" conf presentations.&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jun 2022 06:55:57 GMT</pubDate>
    <dc:creator>isoutamo</dc:creator>
    <dc:date>2022-06-21T06:55:57Z</dc:date>
    <item>
      <title>Failed eval command from sub search numerical results- Any suggestions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Failed-eval-command-from-sub-search-numerical-results-Any/m-p/602491#M209717</link>
      <description>&lt;P&gt;Hello gurus&lt;/P&gt;
&lt;P&gt;I'm trying to return a percentage from the results of sub searches. The value User_count and Device_count are numerical but the eval returns nothing. If I convert either of the values to a number and leave the other named the eval works. Could you offer a suggestion to make this search work please? Thank you!&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index="test" earliest=-2d@d latest=-1d@d
| dedup User
| stats count(User) as User_count
| append [search index="test" | stats dc(SerialNumber) as Device_count]
| eval perc=round(User_count/Device_count*100, 2)."%"&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 21 Jun 2022 23:28:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Failed-eval-command-from-sub-search-numerical-results-Any/m-p/602491#M209717</guid>
      <dc:creator>Seawheels51</dc:creator>
      <dc:date>2022-06-21T23:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Failed eval command from sub search numerical results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Failed-eval-command-from-sub-search-numerical-results-Any/m-p/602544#M209743</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;if you are using the same time period for both user and devices you can try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="test" earliest=-2d@d latest=-1d@d
| stats dc(User) as User_count dc(SerialNumber) as Device_count
| eval perc=round(User_count/Device_count*100, 2)."%"&lt;/LI-CODE&gt;&lt;P&gt;In SPL you should almost always replace join, append* with stats. There are lot of presentation what to do it e.g. &amp;nbsp;&lt;A href="https://conf.splunk.com/watch/conf-online.html?search=%22Nick%20Mealy%22#/" target="_blank"&gt;https://conf.splunk.com/watch/conf-online.html?search=%22Nick%20Mealy%22#/&lt;/A&gt;&amp;nbsp;are links to Nick's "yearly" conf presentations.&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 06:55:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Failed-eval-command-from-sub-search-numerical-results-Any/m-p/602544#M209743</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2022-06-21T06:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: Failed eval command from sub search numerical results- Any suggestions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Failed-eval-command-from-sub-search-numerical-results-Any/m-p/602863#M209833</link>
      <description>&lt;P&gt;Thank you, that achieved the desired results! I appreciate the prompt and accurate response, well done!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 18:36:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Failed-eval-command-from-sub-search-numerical-results-Any/m-p/602863#M209833</guid>
      <dc:creator>Seawheels51</dc:creator>
      <dc:date>2022-06-22T18:36:04Z</dc:date>
    </item>
  </channel>
</rss>

