<?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 Devices In Splunk- How can I create syntax, an alert, and create a table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Devices-In-Splunk-How-can-I-create-syntax-an-alert-and-create-a/m-p/616513#M214271</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please can someone assist with creating syntax to&lt;/P&gt;
&lt;P&gt;1. know the numbers of desktop, laptops, servers and network devices that I have onboarded into Splunk cloud?&lt;/P&gt;
&lt;P&gt;2. Create alert if a new device is onboarded?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Count the numbers of the different types of devices that have been onboarded&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4. create a table for the above&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Oct 2022 14:06:49 GMT</pubDate>
    <dc:creator>codeJesus</dc:creator>
    <dc:date>2022-10-10T14:06:49Z</dc:date>
    <item>
      <title>Devices In Splunk- How can I create syntax, an alert, and create a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Devices-In-Splunk-How-can-I-create-syntax-an-alert-and-create-a/m-p/616513#M214271</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please can someone assist with creating syntax to&lt;/P&gt;
&lt;P&gt;1. know the numbers of desktop, laptops, servers and network devices that I have onboarded into Splunk cloud?&lt;/P&gt;
&lt;P&gt;2. Create alert if a new device is onboarded?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Count the numbers of the different types of devices that have been onboarded&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4. create a table for the above&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 14:06:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Devices-In-Splunk-How-can-I-create-syntax-an-alert-and-create-a/m-p/616513#M214271</guid>
      <dc:creator>codeJesus</dc:creator>
      <dc:date>2022-10-10T14:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Devices In Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Devices-In-Splunk-How-can-I-create-syntax-an-alert-and-create-a/m-p/616521#M214275</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250198"&gt;@codeJesus&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;the solution to your question depends on how you classified your data, in other words:&lt;/P&gt;&lt;P&gt;if you archived e.g.:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;desktop and laptops data in the wineventlog index,&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;windows servers data in the winservers index&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;linux servers in the os index&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;network devices data in the appliance index&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;it's easy to make the work you ask:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;to solve items 1,2,4 run something like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| metasearch index=* 
| stats values(host) AS host count BY index&lt;/LI-CODE&gt;&lt;P&gt;for the item 3, you have to create a lookup&amp;nbsp;(called e.g. perimeter.csv), to update e.g. every night using a search like the following&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| metasearch index=* 
| dedup host
| sort host
| table host
| outputlookup perimeter.csv&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;then you can create an alert like the following that's firing if there's a new host sending logs:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| metasearch index=* NOT [ | inputlookup perimeter.csv | fields host ]
| stats count By host&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;It's a little more complicated if you don't have a classification by index.&lt;/P&gt;&lt;P&gt;In this case, you have to create a lookup like the following&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| metasearch index=* 
| dedup host
| sort host
| table host
| outputlookup perimeter.csv&lt;/LI-CODE&gt;&lt;P&gt;and then manually add the type of the host.&lt;/P&gt;&lt;P&gt;If you have a rule (e.g. a naming convention, you could use it to classify the hosts&amp;nbsp;e.g.;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;windows servers hostname start with srvwinxxxxx,&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;desktop and laptops hostname&amp;nbsp; start with dskwinxxxx,&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;linux servers hostname start with srvlnxxxxx,&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;network devices hostname is an IP address or start with applxxxx.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;in this case you can extract the type with an eval:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| metasearch index=* 
| dedup host
| sort host
| table host
| eval type=case(like(host,"%srvwin%"),"windows Server",like(host,"%dskwin%"),"windows Desktop",like(host,"%srvlnx%"),"Linux Server",like(host,"%appl%"),"Network Device")
| outputlookup perimeter.csv&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 12:12:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Devices-In-Splunk-How-can-I-create-syntax-an-alert-and-create-a/m-p/616521#M214275</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-10T12:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Devices In Splunk- How can I create syntax, an alert, and create a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Devices-In-Splunk-How-can-I-create-syntax-an-alert-and-create-a/m-p/617947#M214763</link>
      <description>&lt;P&gt;Thanks for this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;does any one know the SPL to check for the windows OS types that have been ingested into Splunk? I have run several SPL queries but it didnt work&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 08:14:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Devices-In-Splunk-How-can-I-create-syntax-an-alert-and-create-a/m-p/617947#M214763</guid>
      <dc:creator>codeJesus</dc:creator>
      <dc:date>2022-10-21T08:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Devices In Splunk- How can I create syntax, an alert, and create a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Devices-In-Splunk-How-can-I-create-syntax-an-alert-and-create-a/m-p/617948#M214764</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250198"&gt;@codeJesus&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;to check the Windows OS ingested you have to install the Splunk_TA_Windows (&lt;A href="https://splunkbase.splunk.com/app/742)" target="_blank"&gt;https://splunkbase.splunk.com/app/742)&lt;/A&gt;&amp;nbsp;and enable the input (WinHostMon://OperatingSystem) that sends you the information about the OS.&lt;/P&gt;&lt;P&gt;Then you have only to display these information.&lt;/P&gt;&lt;P&gt;It's obviously a data that doesn't change so frequently, so you can extract it also une time a day or one time a week.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 08:21:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Devices-In-Splunk-How-can-I-create-syntax-an-alert-and-create-a/m-p/617948#M214764</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-21T08:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Devices In Splunk- How can I create syntax, an alert, and create a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Devices-In-Splunk-How-can-I-create-syntax-an-alert-and-create-a/m-p/617949#M214765</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250198"&gt;@codeJesus&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 08:22:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Devices-In-Splunk-How-can-I-create-syntax-an-alert-and-create-a/m-p/617949#M214765</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-21T08:22:26Z</dc:date>
    </item>
  </channel>
</rss>

