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

[FEATURE REQUEST] - Engine "tag" parameter does not accept wildcards #67130

Open
z900collector opened this issue Jan 7, 2025 · 0 comments
Open
Labels
Feature new functionality including changes to functionality and code refactors, etc. needs-triage

Comments

@z900collector
Copy link

When processing Beacon data using an "Engine" the "tag" in the call event = event_bus.get_event(tag="salt/beacon/") does not appear to allow wildcards, therefore you cannot specify the actual beacon type you wish to capture and process.

Describe the solution you'd like
Allow the tag parameter to accept wildcards so that the relevant events can be filter before the call exits.
Example:
event = event_bus.get_event(tag="salt/beacon/*/btmp")
event = event_bus.get_event(tag="salt/beacon/*/load/")

Describe alternatives you've considered
A workaround is to just attempt to access the expected fields and skip processing if they are not present.

Additional context

Example Load Beacon processing as currently implemented:

def start():
with event_bus_context(opts) as event_bus:
while True:
event = event_bus.get_event(wait=10,tag="salt/beacon/")
if event:
id = event.get("id", "")
m1 = event.get("1m", "")
if m1 != "":
m5 = event.get("5m","")
m15 = event.get("15m","")
write_load_data(id,m1,m5,m15)

Example diskusage beacon as currently implemented:

def start():
with event_bus_context(opts) as event_bus:
while True:
event = event_bus.get_event(wait=10,tag="salt/beacon/")
if event:
id = event.get("id", "")
diskusage = event.get("diskusage", "")
if diskusage != "":
mount = event.get("mount","")
write_diskusage_data(id,mount,diskusage)

Changes would not break existing code.

@z900collector z900collector added Feature new functionality including changes to functionality and code refactors, etc. needs-triage labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature new functionality including changes to functionality and code refactors, etc. needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant