[FEATURE REQUEST] - Engine "tag" parameter does not accept wildcards #67335
z900collector
started this conversation in
Feature Requests
Replies: 2 comments 1 reply
-
Any traction on this? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Do I generate the PR? Never done one so I will have to research this...
Sid Young
W: https://off-grid-engineering.com
W: (personal) https://sidyoung.com/
W: (personal) https://z900collector.wordpress.com/
…On Wed, Feb 19, 2025 at 11:24 AM Daniel Wozniak ***@***.***> wrote:
We'll happily accept a PR for this. Otherwise, no traction at the moment.
—
Reply to this email directly, view it on GitHub
<#67335 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABRLBVBLOMHD7R76ZQKGGSL2QPMONAVCNFSM6AAAAABXM7QZPWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMRUGM4TKMY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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.
Beta Was this translation helpful? Give feedback.
All reactions