<?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 Example of connecting snow cmdb ci server to service in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Example-of-connecting-snow-cmdb-ci-server-to-service/m-p/678134#M231910</link>
    <description>&lt;P&gt;We are working to link&amp;nbsp;server information to the&amp;nbsp;services in the ServiceNow CMDB. We are looking for example to r&lt;SPAN&gt;elationship between CI. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Feb 2024 20:55:07 GMT</pubDate>
    <dc:creator>twadeus</dc:creator>
    <dc:date>2024-02-20T20:55:07Z</dc:date>
    <item>
      <title>Example of connecting snow cmdb ci server to service</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Example-of-connecting-snow-cmdb-ci-server-to-service/m-p/678134#M231910</link>
      <description>&lt;P&gt;We are working to link&amp;nbsp;server information to the&amp;nbsp;services in the ServiceNow CMDB. We are looking for example to r&lt;SPAN&gt;elationship between CI. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 20:55:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Example-of-connecting-snow-cmdb-ci-server-to-service/m-p/678134#M231910</guid>
      <dc:creator>twadeus</dc:creator>
      <dc:date>2024-02-20T20:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Example of connecting snow cmdb ci server to service</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Example-of-connecting-snow-cmdb-ci-server-to-service/m-p/678602#M232041</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We can use the cmdb_ci and cmdb_rel_ci tables to analyze CI relationships. For this example, we'll use Splunk Add-on for ServiceNow 7.7.0 with the cmdb_ci and cmdb_rel_ci inputs configured and enabled.&lt;/P&gt;&lt;P&gt;The number and types of relationships will vary depending on our model. We'll use the relationships described in the ServiceNow Common Service Data Model at &lt;A href="https://docs.servicenow.com/bundle/washingtondc-servicenow-platform/page/product/csdm-implementation/concept/ci-relationships.html" target="_self"&gt;https://docs.servicenow.com/bundle/washingtondc-servicenow-platform/page/product/csdm-implementation/concept/ci-relationships.html&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;Application Service -[ Depends on::Used by ]-&amp;gt; Application&lt;BR /&gt;Application -[ Runs on::Runs ]-&amp;gt; Infrastructure CIs&lt;/P&gt;&lt;P&gt;If we're not using Service Mapping, the CI classes and relationships may differ.&lt;/P&gt;&lt;P&gt;We'll create several sample CIs with appropriate relationships:&lt;/P&gt;&lt;P&gt;Splunk::Application Service -[ Depends on::Used by ]-&amp;gt; Splunk Enterprise::Application&lt;BR /&gt;Splunk Enterprise::Application -[ Runs on::Runs ]-&amp;gt; splunk-cm-1::Linux Server&lt;BR /&gt;Splunk Enterprise::Application -[ Runs on::Runs ]-&amp;gt; splunk-idx-1::Linux Server&lt;BR /&gt;Splunk Enterprise::Application -[ Runs on::Runs ]-&amp;gt; splunk-idx-2::Linux Server&lt;BR /&gt;Splunk Enterprise::Application -[ Runs on::Runs ]-&amp;gt; splunk-idx-3::Linux Server&lt;BR /&gt;Splunk Enterprise::Application -[ Runs on::Runs ]-&amp;gt; splunk-sh-1::Linux Server&lt;/P&gt;&lt;P&gt;We'll start our search with the required relationships:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;index=snow sourcetype=snow:cmdb_rel_ci dv_type IN ("Depends on::Used by" "Runs on::Runs") earliest=0 latest=now&lt;/LI-CODE&gt;&lt;P&gt;If we have more than one ServiceNow instance, we can add endpoint=&lt;A href="https://xxx" target="_blank"&gt;https://xxx&lt;/A&gt; to our searches, where xxx is the fully-qualified domain name of our instance.&lt;/P&gt;&lt;P&gt;sourcetype=snow:cmdb_rel_ci includes the following fields of interest:&lt;/P&gt;&lt;P&gt;sys_id&lt;BR /&gt;parent&lt;BR /&gt;dv_type&lt;BR /&gt;child&lt;/P&gt;&lt;P&gt;illustrated by:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;index=snow sourcetype=snow:cmdb_rel_ci dv_type="Depends on::Used by" earliest=0 latest=now
| stats latest(parent) as parent latest(child) as child by sys_id&lt;/LI-CODE&gt;&lt;P&gt;Using sourcetype=snow:cmdb_ci_list and sourcetype=snow:cmdb_rel_ci, we can graph relationships using join:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;index=snow sourcetype=snow:cmdb_ci_list dv_sys_class_name="Mapped Application Service" name=Splunk earliest=0 latest=now
| stats latest(name) as name by sys_id
| rename name as service_name, sys_id as service_sys_id
| join type=left max=0 service_sys_id
    [ search index=snow sourcetype=snow:cmdb_rel_ci dv_type="Depends on::Used by" earliest=0 latest=now
    | stats latest(parent) as service_sys_id latest(child) as application_sys_id by sys_id
    | fields service_sys_id application_sys_id ]
| join type=left max=0 application_sys_id
    [ search index=snow sourcetype=snow:cmdb_ci_list earliest=0 latest=now
    | stats latest(name) as name by sys_id
    | rename name as application_name, sys_id as application_sys_id ]
| join type=left max=0 application_sys_id
    [ search index=snow sourcetype=snow:cmdb_rel_ci dv_type="Runs on::Runs" earliest=0 latest=now
    | stats latest(parent) as application_sys_id latest(child) as server_sys_id by sys_id
    | fields application_sys_id server_sys_id ]
| join type=left max=0 server_sys_id
    [ search index=snow sourcetype=snow:cmdb_ci_list earliest=0 latest=now
    | stats latest(name) as name by sys_id
    | rename name as server_name, sys_id as server_sys_id ]
| stats values(server_name) as server_name by service_name&lt;/LI-CODE&gt;&lt;P&gt;We can add search predicates to the sourcetype=snow:cmdb_ci_list subsearches, e.g. dv_operational_status=Operational, to limit the CIs returned.&lt;/P&gt;&lt;P&gt;Note that Splunk doesn't "know" if a CI is deleted. If we delete a CI or have multiple CIs with the same name but different sys_id values, invalid or duplicate CIs by name will appear in the search results.&lt;/P&gt;&lt;P&gt;Given the searches above, we should highlight:&lt;/P&gt;&lt;P&gt;1) earliest=0 latest=now will return all currently available events. This is not only inefficient for a large number of static CIs or a moderate number of frequently updated CIs, it's also subject to the limits of our indexer cluster and index configurations: SmartStore cache may be exceeded, older CIs may be in frozen buckets, etc.&lt;/P&gt;&lt;P&gt;2) The join command can be inefficient and is subject to subsearch limits in limits.conf.&lt;/P&gt;&lt;P&gt;What are the alternatives? We can refactor the searches using transaction, stats, etc. and creative logic, but we'll still be subject to index lifecycle limits and the frequency of CI updates. We can create KV store collections to store CIs, but do we want to clone our CMDB in both indexes and KV store collections? KV store collections also have limits. If we're in a Splunk Cloud environment, for example, increasing instance disk space to store large collections is a challenge.&lt;/P&gt;&lt;P&gt;In my own work, I've replicated CMDB data to Neo4j and used Cypher to query and analyze CI relationships. You may be interested in the Common Metadata Data Model (CMDM) &lt;A href="https://splunkbase.splunk.com/app/5508" target="_self"&gt;https://splunkbase.splunk.com/app/5508&lt;/A&gt; app by&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/103016"&gt;@lekanneer&lt;/a&gt;. The app implements much of what's required to use Neo4j with Splunk.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Feb 2024 16:39:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Example-of-connecting-snow-cmdb-ci-server-to-service/m-p/678602#M232041</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2024-02-25T16:39:15Z</dc:date>
    </item>
  </channel>
</rss>

