08 Sep 2025 10:56 PM
Hi
I have created two variables
Cluster:
fetch dt.entity.kubernetes_cluster
| fields entity.name
| sort entity.name asc
Namespace:
fetch dt.entity.cloud_application_namespace
| fields id, name = entity.name
// show only namespaces in the selected cluster
| filter in(id, classicEntitySelector(concat("type(CLOUD_APPLICATION_NAMESPACE),toRelationship.isClusterOfNamespace(type(KUBERNETES_CLUSTER),entityName.equals(", $Cluster, "))")))
| fields name
| sort name asc
Based on the above parameters Cluster and Namespace I need to get workloads.
Below query returns all deployments, I need to filter based on above cluster and namespace
fetch dt.entity.cloud_application
| fields entity.name
| dedup entity.name
Can you please guide me. Thanks
Solved! Go to Solution.
09 Sep 2025 01:23 AM
@vchitti Please try below
fetch dt.entity.cloud_application
| fieldsAdd
clusterId = clustered_by[dt.entity.kubernetes_cluster],
k8s.namespace.name = namespaceName
| lookup [fetch dt.entity.kubernetes_cluster
| fieldsAdd kubernetesClusterId, entity.name
], sourceField:clusterId, lookupField:id, fields:{k8s.cluster.name=entity.name}
|filter {
k8s.cluster.name == $Cluster AND
k8s.namespace.name == $Namespace }
09 Sep 2025 09:12 AM
@p_devulapalli Thank you that worked.