Skip to content

Commit

Permalink
Move delivery_timestamp to doc level
Browse files Browse the repository at this point in the history
Update command event_generator

Remove delivery_timestamp from custom command fields
  • Loading branch information
QU3B1M committed Nov 28, 2024
1 parent 2ecd4c4 commit 123cd3e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
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 @@ -54,6 +54,7 @@ def generate_random_command(include_all_fields=False):

if include_all_fields:
document["@timestamp"] = generate_random_date()
document["delivery_timestamp"] = generate_random_date(parse_date(document["@timestamp"]))
document["agent"]["groups"] = [f"group{random.randint(1, 5)}"],
document["command"]["status"] = random.choice(
["pending", "sent", "success", "failure"])
Expand All @@ -65,7 +66,6 @@ def generate_random_command(include_all_fields=False):
# Generate UUIDs for request_id and order_id
document["command"]["request_id"] = str(uuid.uuid4())
document["command"]["order_id"] = str(uuid.uuid4())
document["command"]["delivery_timestamp"] = generate_random_date(parse_date(document["@timestamp"]))

return document

Expand Down
5 changes: 0 additions & 5 deletions ecs/command/fields/custom/command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,3 @@
level: custom
description: >
UUID generated by the Command Manager.
- name: delivery_timestamp
type: date
level: custom
description: >
The latest date-time for the command to be delivered. Calculated as the current timestamp plus the timeout.
5 changes: 5 additions & 0 deletions ecs/command/fields/subset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ fields:
groups: {}
command:
fields: "*"
delivery_timestamp:
type: date
level: custom
description: >
The latest date-time for the command to be delivered. Calculated as the current timestamp plus the timeout.

0 comments on commit 123cd3e

Please sign in to comment.