INFLUX Multiple Queries

Hello All,
am using 4 different queries to display in table and I need to filter these queries according to my requirements to display Cisco BGP/CDP required value/fields in table. The required queries are mentioned below . What/how could be the best options to do it.

from(bucket: “telegraf”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“subscription”] == “RoutingBGPSubscription”)
|> filter(fn: (r) => r[“source”] == “XRV9K10”)
|> filter(fn: (r) => r[“_field”] == “remote_as_number”)
|> filter(fn: (r) => r[“_measurement”] == “Cisco-IOS-XR-ipv4-bgp-oper:bgp/instances/instance/instance-active/default-vrf/neighbors/neighbor”)
|> distinct()
|> group()
|> drop(columns: [“_start”,“_stop”,“host”,“path”,“subscription”,“_measurement”,“instance_name” ])
|> rename(columns: {neighbor_address: "BGP Remote Speaker IP ", _value: “Remote AS Number”})
|> yield(name: “distinct”)

from(bucket: “telegraf”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“source”] ==“${Device}”)
|> filter(fn: (r) => r[“subscription”] == “RoutingBGPSubscription”)
|> filter(fn: (r) => r[“_measurement”] == “Cisco-IOS-XR-ipv4-bgp-oper:bgp/instances/instance/instance-active/default-vrf/neighbors/neighbor”)
|> filter(fn: (r) => r[“_field”] == “connection_local_address/ipv4_address”)
|> distinct()
|> group()
//|> yield(name: “distinct”)
|> drop(columns: [“_start”,“_stop”,“host”,“path”,“subscription”])
|> rename(columns: {source: “Cisco IOS XR Host Name”, neighbor_address: “BGP Remote Speaker IPs”, _value :“BGP Local Speaker IP” })

from(bucket: “telegraf”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“subscription”] == “RoutingBGPSubscription”)
|> filter(fn: (r) => r[“_field”] == “router_id”)
|> filter(fn: (r) => r[“source”] == “XRV9K10”)
|> filter(fn: (r) => r[“_measurement”] == “Cisco-IOS-XR-ipv4-bgp-oper:bgp/instances/instance/instance-active/default-vrf/neighbors/neighbor”)
|> drop(columns: [“_start”,“_stop”,“host”,“path”,“subscription”])
|> rename(columns: { neighbor_address: “BGP Remote Speaker IPs”, _value :“Remote AS Number” })
|> distinct()
|> group()
|> yield(name: “distinct”)

from(bucket: “telegraf”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“source”] == “XRV9K10”)
|> filter(fn: (r) => r[“_field”] == “cdp_neighbor/device_id” or r[“_field”] == “cdp_neighbor/port_id”)
|> filter(fn: (r) => r[“_measurement”] == “Cisco-IOS-XR-cdp-oper:cdp/nodes/node/neighbors/summaries/summary”)
|> distinct()
|> group()
|> yield(name: “distinct”)

Hello @uniquewaheed,
You’re doing great!
Youre using multiple filter() functions to narrow your data, drop() and rename() to clean up your output, and distinct() and group() as needed for your display requirements.
It looks good to me. Do you have any specific concerns?