<?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: Help with data enrichment in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-data-enrichment/m-p/604761#M210332</link>
    <description>&lt;P&gt;Query #1 is giving fields &lt;SPAN&gt;host,hostGuid and "Days until expire". Your query #2 should contain field host and hostGuid (which it was in previous version). New version has fields&amp;nbsp;customerName, customerGuid,&amp;nbsp; workspaceName and workspaceGuid, thus there are no matching host/hostGuid causing query to fail.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If workspactName and workspaceGuid actually corresponds to host and hostGuid, rename them in query #2 so that they match, like this&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=indexname environment=prod
| rex "Certificates for server agent will expire in (?&amp;lt;expiry&amp;gt;\d+) days"
| stats latest(expiry) AS "Days until expire" BY host environment
| sort 0 "Days until expire"
| eval host=rtrim(host, "prod.net")
| eval host=(host."-prod")
|lookup host hostName as host Output hostGuid
|table host hostGuid "Days until expire"| eval from="events"
| append [
| tstats count from datamodel=datamodelname where `ensure_model_activity`
[| inputlookup host where hostGuid=".*"
| eval host=hostName."*"
| return 10 host] by datamodelfiled.workspaceGuid summariesonly=f allow_old_summaries=t
| rename submissions.* as *
| lookup workspace workspaceGuid output name as workspaceName currentCustomerGuid as customerGuid
| lookup customer customerGuid output name as customerName
| table customerName customerGuid workspaceName workspaceGuid
| fillnull value="Not Found"
| stats count by host hostGuid customerName customerGuid workspaceName workspaceGuid
| fields - count | rename workspaceName as host workspaceGuid as hostGuid | eval from="lookup"
]
| stats values(customerName) as customerName values("Days until expire") as days values(from) as from by host hostGuid
| where mvcount(from)=2 | fields - from&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 07 Jul 2022 13:51:44 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2022-07-07T13:51:44Z</dc:date>
    <item>
      <title>Help with data enrichment</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-data-enrichment/m-p/604587#M210282</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;
&lt;P&gt;I would appreciate your help with the following search, I can't find how to do that,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to add the customer name to the list of hosts&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. the below search return a &lt;STRONG&gt;list of hosts&lt;/STRONG&gt; and their Guid with certificates that going to be expired :&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index= indexname environment=prod
| eval host=rtrim(host, ".prod.net")
| eval host=(host."-prod")
|lookup host-guid hostName as host Output hostGuid
|table host hostGuid&lt;/LI-CODE&gt;
&lt;P&gt;2. the below search return the&lt;STRONG&gt; customer name&lt;/STRONG&gt; per host :&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| inputlookup workspace where poolGuid!=*
[| inputlookup workspaceServer where hostGuid=".*"
| rename workspaceServerGuid as currentWorkspaceServerGuid
| return currentWorkspaceServerGuid]
| lookup workspaceServer workspaceServerGuid as currentWorkspaceServerGuid output hostGuid name as core
| lookup host hostGuid output hostName
| rename currentCustomerGuid as customerGuid name as workspaceName
| lookup customer customerGuid output name as customerName
| stats count by hostName hostGuid core customerName customerGuid workspaceName workspaceGuid
| fields - count&lt;/LI-CODE&gt;
&lt;P&gt;how I can combine for those 2 queries and get the customer name just for hosts from the first search #1&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 14:20:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-data-enrichment/m-p/604587#M210282</guid>
      <dc:creator>Danielle_marks</dc:creator>
      <dc:date>2022-07-07T14:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with data enrichment</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-data-enrichment/m-p/604590#M210283</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index= indexname environment=prod
| eval host=rtrim(host, ".prod.net")
| eval host=(host."-prod")
|lookup host-guid hostName as host Output hostGuid
|table host hostGuid | eval from="events"
| append [
| inputlookup workspace where poolGuid!=*
[| inputlookup workspaceServer where hostGuid=".*"
| rename workspaceServerGuid as currentWorkspaceServerGuid
| return currentWorkspaceServerGuid]
| lookup workspaceServer workspaceServerGuid as currentWorkspaceServerGuid output hostGuid name as core
| lookup host hostGuid output hostName
| rename currentCustomerGuid as customerGuid name as workspaceName
| lookup customer customerGuid output name as customerName
| stats count by hostName hostGuid core customerName customerGuid workspaceName workspaceGuid
| fields - count | rename hostName as host  | eval from="lookup"]
| stats values(customerName) as customerName values(from) as from by host hostGuid
| where mvcount(from)=2 | fields - from&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 Jul 2022 14:05:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-data-enrichment/m-p/604590#M210283</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2022-07-06T14:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help with data enrichment</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-data-enrichment/m-p/604634#M210299</link>
      <description>&lt;P&gt;It works! you are the best, thank you so much&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 17:32:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-data-enrichment/m-p/604634#M210299</guid>
      <dc:creator>Danielle_marks</dc:creator>
      <dc:date>2022-07-06T17:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help with data enrichment</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-data-enrichment/m-p/604704#M210316</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hi again,&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I found few logical problems with the #2 query, so I created a data model and I need to use with tstats :&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;| tstats count from datamodel=datamodel_name where `ensure_model_activity`&lt;BR /&gt;[| inputlookup host-dc5prod where hostGuid=".*"&lt;BR /&gt;| eval host=hostName."*"&lt;BR /&gt;| return 10 host] by Datamodelfiled.workspaceGuid summariesonly=f allow_old_summaries=t&lt;BR /&gt;| rename Datamodelfiled.* as *&lt;BR /&gt;| lookup workspace workspaceGuid output name as workspaceName currentCustomerGuid as customerGuid&lt;BR /&gt;| lookup customer customerGuid output name as customerName&lt;BR /&gt;| table customerName customerGuid workspaceName workspaceGuid&lt;BR /&gt;| fillnull value="Not Found"&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;I tried to run it with the same append you created but maybe it works differently with tstats :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;index=indexname environment=prod&lt;BR /&gt;| rex "Certificates for server agent will expire in (?&amp;lt;expiry&amp;gt;\d+) days"&lt;BR /&gt;| stats latest(expiry) AS "Days until expire" BY host environment&lt;BR /&gt;| sort 0 "Days until expire"&lt;BR /&gt;| eval host=rtrim(host, "prod.net")&lt;BR /&gt;| eval host=(host."-prod")&lt;BR /&gt;|lookup host hostName as host Output hostGuid&lt;BR /&gt;|table host hostGuid "Days until expire"| eval from="events"&lt;BR /&gt;| append [&lt;BR /&gt;| tstats count from datamodel=datamodelname where `ensure_model_activity`&lt;BR /&gt;[| inputlookup host where hostGuid=".*"&lt;BR /&gt;| eval host=hostName."*"&lt;BR /&gt;| return 10 host] by datamodelfiled.workspaceGuid summariesonly=f allow_old_summaries=t&lt;BR /&gt;| rename submissions.* as *&lt;BR /&gt;| lookup workspace workspaceGuid output name as workspaceName currentCustomerGuid as customerGuid&lt;BR /&gt;| lookup customer customerGuid output name as customerName&lt;BR /&gt;| table customerName customerGuid workspaceName workspaceGuid&lt;BR /&gt;| fillnull value="Not Found"&lt;BR /&gt;| stats count by host hostGuid customerName customerGuid workspaceName workspaceGuid&lt;BR /&gt;| fields - count | rename hostName as host | eval from="lookup"&lt;BR /&gt;]&lt;BR /&gt;| stats values(customerName) as customerName values("Days until expire") as days values(from) as from by host hostGuid&lt;BR /&gt;| where mvcount(from)=2 | fields - from&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;do you know what I did wrong here?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 06:22:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-data-enrichment/m-p/604704#M210316</guid>
      <dc:creator>Danielle_marks</dc:creator>
      <dc:date>2022-07-07T06:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help with data enrichment</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-data-enrichment/m-p/604761#M210332</link>
      <description>&lt;P&gt;Query #1 is giving fields &lt;SPAN&gt;host,hostGuid and "Days until expire". Your query #2 should contain field host and hostGuid (which it was in previous version). New version has fields&amp;nbsp;customerName, customerGuid,&amp;nbsp; workspaceName and workspaceGuid, thus there are no matching host/hostGuid causing query to fail.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If workspactName and workspaceGuid actually corresponds to host and hostGuid, rename them in query #2 so that they match, like this&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=indexname environment=prod
| rex "Certificates for server agent will expire in (?&amp;lt;expiry&amp;gt;\d+) days"
| stats latest(expiry) AS "Days until expire" BY host environment
| sort 0 "Days until expire"
| eval host=rtrim(host, "prod.net")
| eval host=(host."-prod")
|lookup host hostName as host Output hostGuid
|table host hostGuid "Days until expire"| eval from="events"
| append [
| tstats count from datamodel=datamodelname where `ensure_model_activity`
[| inputlookup host where hostGuid=".*"
| eval host=hostName."*"
| return 10 host] by datamodelfiled.workspaceGuid summariesonly=f allow_old_summaries=t
| rename submissions.* as *
| lookup workspace workspaceGuid output name as workspaceName currentCustomerGuid as customerGuid
| lookup customer customerGuid output name as customerName
| table customerName customerGuid workspaceName workspaceGuid
| fillnull value="Not Found"
| stats count by host hostGuid customerName customerGuid workspaceName workspaceGuid
| fields - count | rename workspaceName as host workspaceGuid as hostGuid | eval from="lookup"
]
| stats values(customerName) as customerName values("Days until expire") as days values(from) as from by host hostGuid
| where mvcount(from)=2 | fields - from&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 07 Jul 2022 13:51:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-data-enrichment/m-p/604761#M210332</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2022-07-07T13:51:44Z</dc:date>
    </item>
  </channel>
</rss>

