<?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: how to differentiate single sourcetype based on 3 different OS using eval in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/how-to-differentiate-single-sourcetype-based-on-3-different-OS/m-p/576296#M101837</link>
    <description>&lt;P&gt;This Worked !! Thank you .&lt;/P&gt;</description>
    <pubDate>Thu, 25 Nov 2021 09:24:04 GMT</pubDate>
    <dc:creator>dtccsundar</dc:creator>
    <dc:date>2021-11-25T09:24:04Z</dc:date>
    <item>
      <title>how to differentiate single sourcetype based on 3 different OS using eval</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-differentiate-single-sourcetype-based-on-3-different-OS/m-p/576283#M101831</link>
      <description>&lt;P&gt;I have a single sourcetype where i need to differentiate the same sourcetype into 3 different categories based on OS field .I tried using append but since takes lot of memory by calling same sourcetype 3 different times ,i need a different approach instead of append.&lt;/P&gt;&lt;P&gt;My code :&lt;/P&gt;&lt;P&gt;index=A sourcetype=Server&lt;BR /&gt;| fillnull value=""&lt;BR /&gt;| eval OS=case(like(Operating_System,"%Windows%"),"Windows",like(Operating_System,"%Linux%"),"Linux",like(Operating_System,"%Missing%"),"Others",like(Operating_System,"%Solaris%"),"Solaris",like(Operating_System,"%AIX%"),"AIX",1=1,"Others")&lt;BR /&gt;| eval Environment=case(like(Environment,"%Prod%"),"Prod",like(Environment,"%Production%"),"Prod",1=1,Environment)&lt;BR /&gt;| search OS="Linux" OR OS="Solaris" AND Environment="PSE" OR Environment="Prod" AND Eligibility="Upper" AND Status="Installed"&lt;BR /&gt;| eval group="Unix Server"&lt;/P&gt;&lt;P&gt;| append&lt;BR /&gt;[| search index=A sourcetype=Server&lt;BR /&gt;| fillnull value=""&lt;BR /&gt;| eval OS=case(like(Operating_System,"%Windows%"),"Windows",like(Operating_System,"%Linux%"),"Linux",like(Operating_System,"%Missing%"),"Others",like(Operating_System,"%Solaris%"),"Solaris",like(Operating_System,"%AIX%"),"AIX",1=1,"Others")&lt;BR /&gt;| eval Environment=case(like(Environment,"%Prod%"),"Prod",like(Environment,"%Production%"),"Prod",1=1,Environment)&lt;BR /&gt;| search OS="Windows" AND Environment="PSE" OR Environment="Prod" AND Eligibility="Upper" AND Hardware_Status="Installed"&lt;BR /&gt;| eval group="Windows "]|stats count by group&lt;/P&gt;&lt;P&gt;Can this be merged into one single query without using append ? This will help me to not running same sourcetype 2 times.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 06:35:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-differentiate-single-sourcetype-based-on-3-different-OS/m-p/576283#M101831</guid>
      <dc:creator>dtccsundar</dc:creator>
      <dc:date>2021-11-25T06:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to differentiate single sourcetype based on 3 different OS using eval</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-differentiate-single-sourcetype-based-on-3-different-OS/m-p/576285#M101832</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/170299"&gt;@dtccsundar&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can create group field using one more case like below;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=A sourcetype=Server 
| fillnull value="" 
| eval OS=case(like(Operating_System,"%Windows%"),"Windows",like(Operating_System,"%Linux%"),"Linux",like(Operating_System,"%Missing%"),"Others",like(Operating_System,"%Solaris%"),"Solaris",like(Operating_System,"%AIX%"),"AIX",1=1,"Others") 
| eval Environment=case(like(Environment,"%Prod%"),"Prod",like(Environment,"%Production%"),"Prod",1=1,Environment) 
| search OS IN ("Linux","Solaris","Windows") (Environment="PSE" OR Environment="Prod") Eligibility="Upper" (Status="Installed" OR Hardware_Status="Installed") 
| eval group=case((OS="Linux" OR OS="Solaris") AND Status="Installed","Unix Server",(OS="Windows" OR OS="Solaris") AND Hardware_Status="Installed","Windows") 
| stats count by group&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 Nov 2021 06:56:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-differentiate-single-sourcetype-based-on-3-different-OS/m-p/576285#M101832</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-11-25T06:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to differentiate single sourcetype based on 3 different OS using eval</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-differentiate-single-sourcetype-based-on-3-different-OS/m-p/576286#M101833</link>
      <description>&lt;P&gt;You can combine using another eval for group.&lt;/P&gt;&lt;P&gt;For e.g&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=A sourcetype=Server
| fillnull value=""
| eval OS=case(like(Operating_System,"%Windows%"),"Windows",like(Operating_System,"%Linux%"),"Linux",like(Operating_System,"%Missing%"),"Others",like(Operating_System,"%Solaris%"),"Solaris",like(Operating_System,"%AIX%"),"AIX",1=1,"Others")
| eval Environment=case(like(Environment,"%Prod%"),"Prod",like(Environment,"%Production%"),"Prod",1=1,Environment)
| search (Environment="PSE" OR Environment="Prod") AND Eligibility="Upper" AND Status="Installed"
| eval group = case(OS="Windows","Windows",OS="Linux" OR OS="Solaris","Unix Server",1=1,"Unknown")
| stats count by group&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 Nov 2021 07:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-differentiate-single-sourcetype-based-on-3-different-OS/m-p/576286#M101833</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2021-11-25T07:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to differentiate single sourcetype based on 3 different OS using eval</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-differentiate-single-sourcetype-based-on-3-different-OS/m-p/576296#M101837</link>
      <description>&lt;P&gt;This Worked !! Thank you .&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 09:24:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-differentiate-single-sourcetype-based-on-3-different-OS/m-p/576296#M101837</guid>
      <dc:creator>dtccsundar</dc:creator>
      <dc:date>2021-11-25T09:24:04Z</dc:date>
    </item>
  </channel>
</rss>

