I have created a dashboard with variable that can ...
# support
c
I have created a dashboard with variable that can switch over the cluster name. My issue is that, how can I configure the panel on querying logs based on the cluster name that i select from the dashboard variable?
For example, the value in the panel will be based on the variable in the"$test".
s
Use the variable value in condition
k8.cluster.name = $test
c
may i ask if it can be used in this way?
Copy code
SELECT
toStartOfInterval(fromUnixTimestamp64Nano(timestamp), INTERVAL 1 MINUTE) AS ts,
toFloat64(count()) AS value
FROM
signoz_logs.distributed_logs_v2
WHERE
(timestamp >= {{.start_timestamp_nano}} AND timestamp <= {{.end_timestamp_nano}})
AND body LIKE '%k8.cluster.name = $test%'
AND body LIKE '%/test/test1%'
AND body LIKE '%HTTP/1.1" 200%'
GROUP BY ts
ORDER BY ts ASC;
s
No. This is neither recommended. Please extract the cluster name into attributes.
c
is there any reference/guide that I can refer to ?
Hi @Srikanth Chekuri, I have multiple clusters connecting to a single SigNoz. What I aim to do is to count the appearance of these strings in the logs in a cluster. Therefore, when I change the cluster name, the value showing will be changing to count the appearance of the strings in that specific cluster.