<?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 Getting all IP addresses from guests in VMware vCenter in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Getting-all-IP-addresses-from-guests-in-VMware-vCenter/m-p/310394#M58333</link>
    <description>&lt;P&gt;Hey folks,&lt;/P&gt;

&lt;P&gt;I am using a VMware DCN (data collection node) to index all of my performance, event, and inventory data from our VMware environment.  This is a standalone Splunk Enterprise instance running 6.6.2, not a virtual appliance.&lt;/P&gt;

&lt;P&gt;I am working on a set of dashboards to lookup VMs, hypervisors, etc, and I'm seeing some weirdness in the data.  I'm hoping someone can help me out, because my brain doesn't grok JSON and I have a helluva time with multivalue fields.&lt;/P&gt;

&lt;P&gt;Here is the search I am running that gives some weirdness.  I am specifically looking at &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;tag=virtualmachine tag=inventory tag=virtualization vm_name="*" 
| stats delim="," latest(vm_name) as vm_name, latest(storage_capacity) as storage_capacity, latest(mem_capacity) as mem_capacity, latest(processor_socket_count) as processor_socket_count, latest(cpu_cores) as cpu_cores, latest(logical_cpu_count) as logical_cpu_count, latest(power_state) as power_state, latest(vm_os) as vm_os, values(ip) as ip, values(datastore) as datastore, values(datastore_volume_path) as datastore_volume_path, latest(cluster_id) as cluster_id, latest(cluster_name) as cluster_name, latest(hypervisor_name) as hypervisor_name, by vm_id 
| eval storage_capacity=round(storage_capacity/1024/1024/1024) 
| eval mem_capacity=round(mem_capacity/1024/1024/1024) 
| eval hypervisor_name=upper(mvindex(split(hypervisor_name,"."),0))
| rename vm_id as "VM ID", vm_name as "VM Name", storage_capacity as "Storage Capacity (in GB)", mem_capacity as "Memory Capacity (in GB)", processor_socket_count as "CPU Socket Count", cpu_cores as "CPU Cores", logical_cpu_count as "Logical CPU Count", power_state as "Power State", vm_os as "VM Operating System", ip as "IP Address(es)", datastore as "Datastore(s)", datastore_volume_path as "Datastore Volume Path", hypervisor_name as "Found on Hypervisor", cluster_id as "Cluster ID", cluster_name as "Cluster Name"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now, this appears to work, but I only get the last IP address for guests that have multiple IPs assigned.  If I look at the event itself, I find the list of IP addresses for the guest in:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{   [-] 
   changeSet: { [-] 
     guest: {   [-] 
       disk: {  [+] 
       }    
       guestFamily: linuxGuest  
       guestFullName: Red Hat Enterprise Linux 7 (64-bit)   
       guestId: rhel7_64Guest   
       guestOperationsReady: True   
       guestState: running  
       hostName: hostname   
       ipAddress: just_one_of_the_ip_addresses
       ipStack: {   [+] 
       }    
       net: {   [-] 
         GuestNicInfo: [    [-] 
           {    [-] 
             connected: True    
             deviceConfigId: 4000   
             ipAddress: [   [-] 
               ip_address_1 
               ip_address_2 
               ip_address_3 
             ]  
             ipConfig: {    [+] 
             }  
             macAddress: 00:aa:bb:cc:dd:ee  
             network: myVLAN    
           }    
         ]  
       }    
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My search is giving me the &lt;CODE&gt;just_one_of_the_ip_addresses&lt;/CODE&gt; value, while I see the correct list of them in &lt;CODE&gt;ip_address_1&lt;/CODE&gt;, &lt;CODE&gt;_2&lt;/CODE&gt;, &lt;CODE&gt;_3&lt;/CODE&gt;.  But I have no idea how to access them and display the list of them.&lt;/P&gt;

&lt;P&gt;Can someone help my brain wrap around the JSON + multivalue field thing?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Fri, 01 Dec 2017 17:54:52 GMT</pubDate>
    <dc:creator>bensec01</dc:creator>
    <dc:date>2017-12-01T17:54:52Z</dc:date>
    <item>
      <title>Getting all IP addresses from guests in VMware vCenter</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Getting-all-IP-addresses-from-guests-in-VMware-vCenter/m-p/310394#M58333</link>
      <description>&lt;P&gt;Hey folks,&lt;/P&gt;

&lt;P&gt;I am using a VMware DCN (data collection node) to index all of my performance, event, and inventory data from our VMware environment.  This is a standalone Splunk Enterprise instance running 6.6.2, not a virtual appliance.&lt;/P&gt;

&lt;P&gt;I am working on a set of dashboards to lookup VMs, hypervisors, etc, and I'm seeing some weirdness in the data.  I'm hoping someone can help me out, because my brain doesn't grok JSON and I have a helluva time with multivalue fields.&lt;/P&gt;

&lt;P&gt;Here is the search I am running that gives some weirdness.  I am specifically looking at &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;tag=virtualmachine tag=inventory tag=virtualization vm_name="*" 
| stats delim="," latest(vm_name) as vm_name, latest(storage_capacity) as storage_capacity, latest(mem_capacity) as mem_capacity, latest(processor_socket_count) as processor_socket_count, latest(cpu_cores) as cpu_cores, latest(logical_cpu_count) as logical_cpu_count, latest(power_state) as power_state, latest(vm_os) as vm_os, values(ip) as ip, values(datastore) as datastore, values(datastore_volume_path) as datastore_volume_path, latest(cluster_id) as cluster_id, latest(cluster_name) as cluster_name, latest(hypervisor_name) as hypervisor_name, by vm_id 
| eval storage_capacity=round(storage_capacity/1024/1024/1024) 
| eval mem_capacity=round(mem_capacity/1024/1024/1024) 
| eval hypervisor_name=upper(mvindex(split(hypervisor_name,"."),0))
| rename vm_id as "VM ID", vm_name as "VM Name", storage_capacity as "Storage Capacity (in GB)", mem_capacity as "Memory Capacity (in GB)", processor_socket_count as "CPU Socket Count", cpu_cores as "CPU Cores", logical_cpu_count as "Logical CPU Count", power_state as "Power State", vm_os as "VM Operating System", ip as "IP Address(es)", datastore as "Datastore(s)", datastore_volume_path as "Datastore Volume Path", hypervisor_name as "Found on Hypervisor", cluster_id as "Cluster ID", cluster_name as "Cluster Name"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now, this appears to work, but I only get the last IP address for guests that have multiple IPs assigned.  If I look at the event itself, I find the list of IP addresses for the guest in:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{   [-] 
   changeSet: { [-] 
     guest: {   [-] 
       disk: {  [+] 
       }    
       guestFamily: linuxGuest  
       guestFullName: Red Hat Enterprise Linux 7 (64-bit)   
       guestId: rhel7_64Guest   
       guestOperationsReady: True   
       guestState: running  
       hostName: hostname   
       ipAddress: just_one_of_the_ip_addresses
       ipStack: {   [+] 
       }    
       net: {   [-] 
         GuestNicInfo: [    [-] 
           {    [-] 
             connected: True    
             deviceConfigId: 4000   
             ipAddress: [   [-] 
               ip_address_1 
               ip_address_2 
               ip_address_3 
             ]  
             ipConfig: {    [+] 
             }  
             macAddress: 00:aa:bb:cc:dd:ee  
             network: myVLAN    
           }    
         ]  
       }    
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My search is giving me the &lt;CODE&gt;just_one_of_the_ip_addresses&lt;/CODE&gt; value, while I see the correct list of them in &lt;CODE&gt;ip_address_1&lt;/CODE&gt;, &lt;CODE&gt;_2&lt;/CODE&gt;, &lt;CODE&gt;_3&lt;/CODE&gt;.  But I have no idea how to access them and display the list of them.&lt;/P&gt;

&lt;P&gt;Can someone help my brain wrap around the JSON + multivalue field thing?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 17:54:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Getting-all-IP-addresses-from-guests-in-VMware-vCenter/m-p/310394#M58333</guid>
      <dc:creator>bensec01</dc:creator>
      <dc:date>2017-12-01T17:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Getting all IP addresses from guests in VMware vCenter</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Getting-all-IP-addresses-from-guests-in-VMware-vCenter/m-p/310395#M58334</link>
      <description>&lt;P&gt;The command that you need is &lt;CODE&gt;spath&lt;/CODE&gt;:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Spath"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Spath&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Dec 2017 21:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Getting-all-IP-addresses-from-guests-in-VMware-vCenter/m-p/310395#M58334</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-12-02T21:26:02Z</dc:date>
    </item>
  </channel>
</rss>

