<?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: SPL QUERY in Training + Certification Discussions</title>
    <link>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/577057#M1371</link>
    <description>&lt;P&gt;The stats expression&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;count(eval(severity="low")) as low&lt;/FONT&gt; will always return the same value, regardless of the severity level.&amp;nbsp; This is because the &lt;FONT face="courier new,courier"&gt;eval&lt;/FONT&gt; function returns either 0 or 1 and &lt;FONT face="courier new,courier"&gt;count&lt;/FONT&gt; merely says how many 0s and 1s there were - not what you're looking for.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Try using &lt;FONT face="courier new,courier"&gt;sum(eval(severity="low")) as low&lt;/FONT&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Dec 2021 13:35:39 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2021-12-02T13:35:39Z</dc:date>
    <item>
      <title>SPL QUERY</title>
      <link>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/576947#M1370</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a SPL query that will provide the following:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Active_Repository&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Qualifying Statement - &lt;STRONG&gt;Scan Policy&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Qualifying Statement - &lt;STRONG&gt;Credentialed_Scan:true&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Agent_Repository&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Qualifying Statement - &lt;STRONG&gt;Agent_Policy&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Qualifying Statement - &lt;STRONG&gt;Credentialed checks : yes&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Query&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;earliest=-7d@d index=acas "Credentialed Check" OR "credentialed check"&lt;/P&gt;&lt;P&gt;| rex field=operatingSystem "^(?P&amp;lt;OS_Type&amp;gt;\D+)\s(?P&amp;lt;OS_Version&amp;gt;.*)"&lt;/P&gt;&lt;P&gt;| rex field=dnsName "^(?P&amp;lt;hostname&amp;gt;\w+)\.(?P&amp;lt;domain&amp;gt;.*)$"&lt;/P&gt;&lt;P&gt;| rex field=system "^(?P&amp;lt;manufacture&amp;gt;\w+)\.(?P&amp;lt;serialnumber&amp;gt;.*)$&lt;/P&gt;&lt;P&gt;| eval AWS=if(like(dnsName,"cloud%"),"TRUE,"FALSE")&lt;/P&gt;&lt;P&gt;| iplocation ip&lt;/P&gt;&lt;P&gt;| eventstats count(eval(severity="low")) as low, count(eval(severity="medium")) as medium, count(eval(severity="critical")) as critical by ip,hostname, plugin_id&lt;/P&gt;&lt;P&gt;| dedup ip, hostname,plugin_id&lt;/P&gt;&lt;P&gt;| eval total = low+medium+high+critical&lt;/P&gt;&lt;P&gt;| where total&amp;gt;4&lt;/P&gt;&lt;P&gt;| table ip, repository.dataFormat, netbiosName, dnsName, AWS, hostname, macAddress, OS_Type, OS_Version, operatingSystem, SystemManufacutre, SystemSerialNumber, SystemModel, AWSAccountNumber, AWSInstanceID, AWSENI, plugin_id, pluginName, repository.name, cpe, low, medium, high, critical, total, Country, lat, lon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I am not able to get all severity scores.&amp;nbsp; &amp;nbsp;I keep getting a total of either a 0 or 1 for (low, medium, high, critical)&amp;nbsp; severity.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone come across this issue?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 21:01:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/576947#M1370</guid>
      <dc:creator>Omarop</dc:creator>
      <dc:date>2021-12-01T21:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: SPL QUERY</title>
      <link>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/577057#M1371</link>
      <description>&lt;P&gt;The stats expression&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;count(eval(severity="low")) as low&lt;/FONT&gt; will always return the same value, regardless of the severity level.&amp;nbsp; This is because the &lt;FONT face="courier new,courier"&gt;eval&lt;/FONT&gt; function returns either 0 or 1 and &lt;FONT face="courier new,courier"&gt;count&lt;/FONT&gt; merely says how many 0s and 1s there were - not what you're looking for.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Try using &lt;FONT face="courier new,courier"&gt;sum(eval(severity="low")) as low&lt;/FONT&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 13:35:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/577057#M1371</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-12-02T13:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: SPL QUERY</title>
      <link>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/577122#M1372</link>
      <description>&lt;P&gt;Thank you for the response.&amp;nbsp; I did try using the command you provided sum(eval(severity="low")) as low but it only comes back for the low severity level but does not for medium, high, and critical.&amp;nbsp; I keep getting zero.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 18:48:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/577122#M1372</guid>
      <dc:creator>Omarop</dc:creator>
      <dc:date>2021-12-02T18:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: SPL QUERY</title>
      <link>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/577125#M1373</link>
      <description>&lt;P&gt;Do you have events with non-low severity?&amp;nbsp; Please share the complete, modified query.&amp;nbsp; It would help to see some sample events, too.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 19:12:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/577125#M1373</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-12-02T19:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: SPL QUERY</title>
      <link>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/577135#M1374</link>
      <description>&lt;P&gt;Sure down below is the modified SPL QUERY&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Query&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;earliest=-7d@d index=acas "Credentialed Check" OR "credentialed check"&lt;/P&gt;&lt;P&gt;| rex field=operatingSystem "^(?P&amp;lt;OS_Type&amp;gt;\D+)\s(?P&amp;lt;OS_Version&amp;gt;.*)"&lt;/P&gt;&lt;P&gt;| rex field=dnsName "^(?P&amp;lt;hostname&amp;gt;\w+)\.(?P&amp;lt;domain&amp;gt;.*)$"&lt;/P&gt;&lt;P&gt;| rex field=system "^(?P&amp;lt;manufacture&amp;gt;\w+)\.(?P&amp;lt;serialnumber&amp;gt;.*)$&lt;/P&gt;&lt;P&gt;| eval AWS=if(like(dnsName,"cloud%"),"TRUE,"FALSE")&lt;/P&gt;&lt;P&gt;| iplocation ip&lt;/P&gt;&lt;P&gt;| eventstats sum(eval(severity="low")) as low, count(eval(severity="medium")) as medium, count(eval(severity="critical")) as critical by ip,hostname, plugin_id&lt;/P&gt;&lt;P&gt;| dedup ip, hostname,plugin_id&lt;/P&gt;&lt;P&gt;| eval total = low+medium+high+critical&lt;/P&gt;&lt;P&gt;| where total&amp;gt;4&lt;/P&gt;&lt;P&gt;| table ip, repository.dataFormat, netbiosName, dnsName, AWS, hostname, macAddress, OS_Type, OS_Version, operatingSystem, SystemManufacutre, SystemSerialNumber, SystemModel, AWSAccountNumber, AWSInstanceID, AWSENI, plugin_id, pluginName, repository.name, cpe, low, medium, high, critical, total, Country, lat, lon&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 20:17:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/577135#M1374</guid>
      <dc:creator>Omarop</dc:creator>
      <dc:date>2021-12-02T20:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: SPL QUERY</title>
      <link>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/577217#M1375</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;eventstats&lt;/FONT&gt; command was updated for severity=low, but not for the other severity levels.&amp;nbsp; Apply the same change (s/count/sum/) to them and see what results you get.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 13:09:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/577217#M1375</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-12-03T13:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: SPL QUERY</title>
      <link>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/577475#M1376</link>
      <description>&lt;P&gt;I tried inputting the following and did not get any results.&lt;/P&gt;&lt;P&gt;| eventstats count sum(eval(severity="low")) as low, count sum(eval(severity="medium")) as medium, count sum(eval(severity="high")) as high, count sum(eval(severity="critical")) as critical&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 14:36:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/577475#M1376</guid>
      <dc:creator>Omarop</dc:creator>
      <dc:date>2021-12-06T14:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: SPL QUERY</title>
      <link>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/577490#M1377</link>
      <description>&lt;P&gt;I may have missed it in an earlier response, but the correct function is "sum", not "count sum".&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eventstats sum(eval(severity="low")) as low, sum(eval(severity="medium")) as medium, sum(eval(severity="high")) as high, sum(eval(severity="critical")) as critical&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 06 Dec 2021 16:40:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/577490#M1377</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-12-06T16:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: SPL QUERY</title>
      <link>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/577539#M1378</link>
      <description>&lt;P&gt;I think the issue is that you are adding fields with null values and the result becomes null.&lt;/P&gt;&lt;P&gt;Try this before adding the values:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;| fillnull value=0 low medium high critical&lt;/STRONG&gt;&lt;BR /&gt;| eval total=low+medium+high+critical&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Here's a different way to skin the cat.&lt;/P&gt;&lt;P&gt;| eval {severity}=1&lt;BR /&gt;| eventstats sum(low) AS low sum(medium) AS medium sum(high) AS high sum(critical) AS critical by&lt;SPAN&gt;&amp;nbsp;ip,hostname, plugin_id&lt;/SPAN&gt;&lt;BR /&gt;| fillnull value=0 low medium high critical&lt;BR /&gt;| eval total=low+medium+high+critical&lt;BR /&gt;| where total&amp;gt;4&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 02:20:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Training-Certification/SPL-QUERY/m-p/577539#M1378</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2021-12-07T02:20:48Z</dc:date>
    </item>
  </channel>
</rss>

