mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Docs: Fix invalid SQL join in Fleet query (#32494)
The existing query used a CROSS JOIN with USING(id), which is not valid SQL in Fleet/SQLite and resulted in a syntax error when saving the query. This change replaces the CROSS JOIN with a standard JOIN ... ON ... clause. The explicit ON form was chosen for clarity: - Makes the join condition (c.id = p.id) obvious to readers - Avoids the subtle column-merging behavior of USING This preserves the intended behavior (joining containers with their processes by ID) while ensuring the query can be saved and run correctly in Fleet.
This commit is contained in:
parent
7c375c6e54
commit
178ebc7077
1 changed files with 1 additions and 1 deletions
|
|
@ -2275,7 +2275,7 @@ spec:
|
|||
name: Get Docker contained processes on a system
|
||||
platform: darwin, linux
|
||||
description: Docker containers Processes, can be used on normal systems or a kubenode.
|
||||
query: SELECT c.id, c.name, c.image, c.image_id, c.command, c.created, c.state, c.status, p.cmdline FROM docker_containers c CROSS JOIN docker_container_processes p using(id);
|
||||
query: SELECT c.id, c.name, c.image, c.image_id, c.command, c.created, c.state, c.status, p.cmdline FROM docker_containers c JOIN docker_container_processes p ON c.id = p.id;
|
||||
bash: echo "id,name,image,image_id,command,created,state,status,cmdline"; for id in $(docker ps -q); do cont=$(docker inspect --format='{{.Id}},{{.Name}},{{.Config.Image}},{{.Image}},{{.Path}} {{range .Args}}{{.}} {{end}},{{.Created}},{{.State.Status}},{{.State.ExitCode}}' "$id"); docker top "$id" aux | sed '1d' | while IFS= read -r proc; do echo "$cont,\"$proc\""; done; done
|
||||
purpose: Informational
|
||||
tags: built-in, containers, inventory
|
||||
|
|
|
|||
Loading…
Reference in a new issue