I'm trying to create a stats table in Splunk that shows the IP of VMs and the IP of the Host that supports those VMs. Hosts and VMs have been indexed separately. Both indexes have the same field name 'IP.'
(index="cmsvm") OR (index="cmshost") Host=$hostnamefield$ IP=$ipfield$
| dedup VM
| table VM IP MacAddress OperatingSystem_Code Cluster Host B
| fields VM
Where the last field says 'B' I want to see the IP address of the Host, but because there's an IP field in the VM index nothing is returned. Also I want the token to search the IP of the Host not the VM.
(index="cmsvm") host=$hostnamefield$ IP=$ipfield$ | append [ (index="cmshost") host=$hostnamefield$ IP=$ipfield$ | rename IP as hostip] | stats values(IP) as VMIP values(hostip) as HOSTIP values(MacAddress) as MacAddress values(OperatingSystemCode ) as OperatingSystemCode values(Cluster) as Cluster by host