<?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: Not getting results from JOIN in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Not-getting-results-from-JOIN/m-p/33109#M7018</link>
    <description>&lt;P&gt;It appears that the raw values of CLUSTER, VMHOST and VM have a leading whitespace character. The solution is to add a trim() &lt;/P&gt;

&lt;P&gt;index="vmware" sourcetype="esxtop_Group_Cpu" host=* id=* | rex field=_raw "id=[\d]+:(?P&lt;VM&gt;.*)" | fields VM pct_CoStop | stats avg(pct_CoStop) by VM | join type=inner VM [search index="vmware" sourcetype="VM_Inventory" | head 1 | multikv fields DATACENTER CLUSTER VMHOST VM | table DATACENTER CLUSTER VMHOST VM | eval VM = trim(VM)]&lt;/VM&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 09:16:21 GMT</pubDate>
    <dc:creator>Nicholas_Key</dc:creator>
    <dc:date>2020-09-28T09:16:21Z</dc:date>
    <item>
      <title>Not getting results from JOIN</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-getting-results-from-JOIN/m-p/33107#M7016</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;There are two datacubes that I want to perform a join operation. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;The first search string looks like this:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="vmware" sourcetype="esxtop_Group_Cpu" pct_CoStop | rex field=_raw "id=[\d]+:(?P&amp;lt;VM&amp;gt;.*)" | fields VM 

Wed Aug 18 11:33:55 PDT 2010 pct_CoStop=0.00, id=22:LisaSplunk4VMware
Wed Aug 18 11:33:55 PDT 2010 pct_CoStop=0.01, id=21:vCenter
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;The second search string looks like this:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="vmware" sourcetype="VM_Inventory" | head 1 | multikv fields DATACENTER CLUSTER VMHOST VM | table DATACENTER CLUSTER VMHOST VM

DATACENTER  CLUSTER     VMHOST  VM
SF  Intel-Hosts 10.1.6.34   perfVMFS
SF  Intel-Hosts 10.1.6.34   NicholasVMTest
SF  Intel-Hosts 10.1.6.34   Win2003_x86_template
SF  Intel-Hosts 10.1.6.34   LisaSplunk4VMware
SF  Intel-Hosts 10.1.6.34   Support_vm_debian
SF  Intel-Hosts 10.1.6.34   JMW Ubuntu
SF  Intel-Hosts 10.1.6.34   vCenter
SF  Intel-Hosts 10.1.6.23   perfRaw
SF  AMD-Hosts   10.1.12.5   Windows_2k3_64bit
SF  AMD-Hosts   10.1.12.5   SUDAENGW2008
SF  AMD-Hosts   10.1.12.5   Windows_XP_JPN
SF  AMD-Hosts   10.1.12.5   Windows_XP
SF  AMD-Hosts   10.1.12.5   Windows_XP_dev
SF  AMD-Hosts   10.1.12.5   Windows_2K_i386
SF  AMD-Hosts   10.1.12.5   Splunk4VMWare
SF  AMD-Hosts   10.1.12.4   OpenSuse_10_x86_64
SF  AMD-Hosts   10.1.12.4   CentOS_3.9_i386
SF  AMD-Hosts   10.1.12.4   OpenSuse_10_i386
SF  AMD-Hosts   10.1.12.4   Windows_Vista_64bit
SF  AMD-Hosts   10.1.12.4   Solaris10_x86_64
SF  AMD-Hosts   10.1.12.4   CentOS_5.3_x84_64
SF  AMD-Hosts   10.1.12.4   LiveCD2
SF  AMD-Hosts   10.1.12.4   CentOS_3.9_x86_64
SF  AMD-Hosts   10.1.12.4   CentOS_5.1_i386
SF  AMD-Hosts   10.1.12.4   Ubuntu_8.0.4_x86_64
SF  AMD-Hosts   10.1.12.4   Windows_2k8_32bit
SF  AMD-Hosts   10.1.12.4   FreeBSD_6.4_x86_64
SF  AMD-Hosts   10.1.12.4   LiveCD1
SF  AMD-Hosts   10.1.12.4   Windows_2K8_64bit_JPN
SF  AMD-Hosts   10.1.12.4   VMware Infrastructure Management Assistant
SF  AMD-Hosts   10.1.12.4   CentOS_4.6_x86_64
SF  AMD-Hosts   10.1.12.4   CentOS_5.1_x84_64
SF  AMD-Hosts   10.1.12.4   CentOS_4.6_i386
SF  AMD-Hosts   10.1.12.4   Ubuntu_8.0.4_i386
SF  AMD-Hosts   10.1.12.4   Windows_2k3_32bit
SF  AMD-Hosts   10.1.12.4   LiveCD3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, I'm not getting any results from the join operation that I use in this search string.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="vmware" sourcetype="esxtop_Group_Cpu" pct_CoStop | rex field=_raw "id=[\d]+:(?P&amp;lt;VM&amp;gt;.*)" | fields VM pct_CoStop | join VM [search index="vmware" sourcetype="VM_Inventory" | head 1 | multikv fields DATACENTER CLUSTER VMHOST VM | table DATACENTER CLUSTER VMHOST VM]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any thoughts? Is multikv working at all in this scenario?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2010 01:39:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-getting-results-from-JOIN/m-p/33107#M7016</guid>
      <dc:creator>Nicholas_Key</dc:creator>
      <dc:date>2010-08-19T01:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Not getting results from JOIN</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-getting-results-from-JOIN/m-p/33108#M7017</link>
      <description>&lt;P&gt;So, first of all, if this is your own output from the VM_Inventory script (I'm guessing it is because it looks like a reworking of &lt;A href="http://answers.splunk.com/questions/5635/translating-an-event-into-a-table" rel="nofollow"&gt;this answer&lt;/A&gt;.) I would recommend this &lt;EM&gt;not&lt;/EM&gt; be the format you use. Write each item out as a separate event instead of a giant table that you have to separate out with &lt;CODE&gt;multikv&lt;/CODE&gt;. &lt;CODE&gt;multikv&lt;/CODE&gt; is convenient only because so many unix commands provide output that's inconvenient to Splunk, but you should avoid creating stuff like that. Why? Well, for example, if I wanted to report on one specific VM by name, it would be a pain. I can't use automatic lookups against this data effectively. It &lt;EM&gt;does&lt;/EM&gt; have the advantage I suppose that you can efficiently get the latest version of the full list with "head 1" though.&lt;/P&gt;

&lt;P&gt;Alternatively, you might consider pushing this data into a lookup table, depending how often it updates and what you're trying to do with it. It seems to me that at least some of your use case would be well-served by taking the inventory data and periodically writing a lookup table (either directly with your script, or via a scheduled job that took the indexed inventory data and did outputlookup on it.)&lt;/P&gt;

&lt;P&gt;Anyway, to get to your immediate question, I don't know. If the fields actually come out of the individual queries correctly, then you should be getting two results out of your join. And you're getting zero results.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2010 03:24:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-getting-results-from-JOIN/m-p/33108#M7017</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-08-19T03:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: Not getting results from JOIN</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Not-getting-results-from-JOIN/m-p/33109#M7018</link>
      <description>&lt;P&gt;It appears that the raw values of CLUSTER, VMHOST and VM have a leading whitespace character. The solution is to add a trim() &lt;/P&gt;

&lt;P&gt;index="vmware" sourcetype="esxtop_Group_Cpu" host=* id=* | rex field=_raw "id=[\d]+:(?P&lt;VM&gt;.*)" | fields VM pct_CoStop | stats avg(pct_CoStop) by VM | join type=inner VM [search index="vmware" sourcetype="VM_Inventory" | head 1 | multikv fields DATACENTER CLUSTER VMHOST VM | table DATACENTER CLUSTER VMHOST VM | eval VM = trim(VM)]&lt;/VM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:16:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Not-getting-results-from-JOIN/m-p/33109#M7018</guid>
      <dc:creator>Nicholas_Key</dc:creator>
      <dc:date>2020-09-28T09:16:21Z</dc:date>
    </item>
  </channel>
</rss>

