25 Oct 2023
	
		
		07:05 PM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 - last edited on 
    
	
		
		
		27 Oct 2023
	
		
		07:55 AM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 by 
				
		 MaciejNeumann
		
			MaciejNeumann
		
		
		
		
		
		
		
		
	
			
		
Hi,
What is the syntax to create a union of two fetch statmenents, bascially wanted a result of both fetch queires in a single statement
fetch `dt.entity.palo-alto:device`
| fieldsAdd SystemName,deviceAddress,entity.type
| fieldsRename ipaddress=deviceAddress,devicename=SystemName,type=entity.type
 fetch `dt.entity.snmp:com_dynatrace_extension_snmp_generic_cisco_device`
| fieldsAdd system_name,dt.ip_addresses,entity.type
| fieldsRename ipaddress=dt.ip_addresses,devicename=system_name,type=entity.type
Appreciate your response.
Thanks & Regards,
Rama
Solved! Go to Solution.
27 Oct 2023 08:00 AM
Hi @rchillara ,
the DQL equivalent for SQL union is the append command. The following query should work:
fetch `dt.entity.palo-alto:device`
| fieldsAdd SystemName,deviceAddress,entity.type
| fieldsRename ipaddress=deviceAddress,devicename=SystemName,type=entity.type
| append [
fetch `dt.entity.snmp:com_dynatrace_extension_snmp_generic_cisco_device`
| fieldsAdd system_name,dt.ip_addresses,entity.type
| fieldsRename ipaddress=dt.ip_addresses,devicename=system_name,type=entity.type
]
27 Nov 2023 02:13 PM
@stefan_eggersto thank you.
