Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make command.action.args type object instead of keyword type value #630

Merged
merged 4 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ecs/command/event-generator/event_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def generate_random_command(include_all_fields=False):
},
"action": {
"name": random.choice(["restart", "update","change_group", "apply_policy"]),
"args": [f"/path/to/executable/arg{random.randint(1, 10)}"],
"args": { "arg1": f"/path/to/executable/arg{random.randint(1, 10)}"},
"version": f"v{random.randint(1, 5)}"
},
"timeout": random.randint(10, 100)
Expand Down
4 changes: 2 additions & 2 deletions ecs/command/fields/custom/command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
description: >
The requested action type. Examples: `restart`, `update`, `change_group`, `apply_policy`, ...
- name: action.args
type: keyword
type: object
level: custom
description: >
Array of command arguments, starting with the absolute path to the executable.
Command arguments object.
- name: action.version
type: keyword
level: custom
Expand Down
4 changes: 2 additions & 2 deletions ecs/command/fields/mapping-settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"dynamic": "strict",
"dynamic": "true",
"date_detection": false
}
}
2 changes: 1 addition & 1 deletion ecs/docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This index stores information about the commands executed by the agents. The ind
| \* | `command.target.id` | keyword | Unique identifier of the destination to send the command to. |
| \* | `command.target.type` | keyword | The destination type. One of [`group`, `agent`, `server`], |
| \* | `command.action.name` | keyword | The requested action type. Examples: `restart`, `update`, `change_group`, `apply_policy`, ... |
| \* | `command.action.args` | keyword | Array of command arguments, starting with the absolute path to the executable. |
| \* | `command.action.args` | object | Command arguments. The Object type allows for ad-hoc format of the value. |
| \* | `command.action.version` | keyword | Version of the command's schema. |
| \* | `command.timeout` | short | Time window in which the command has to be sent to its target. |
| \* | `command.status` | keyword | Status within the Command Manager's context. One of [`pending`, `sent`, `success`, `failure`]. |
Expand Down