Skip to content

Instantly share code, notes, and snippets.

@Che4ter
Created April 11, 2022 11:18
Show Gist options
  • Save Che4ter/b1a1236ba9e4eebea2b2c4128d3f67fc to your computer and use it in GitHub Desktop.
Save Che4ter/b1a1236ba9e4eebea2b2c4128d3f67fc to your computer and use it in GitHub Desktop.
name: Custom.SBB.Label.NewClients
description: |
This artifact watches for new client enrolments and automatically
label the client with the hostname.
#server #event #labels
type: SERVER_EVENT
parameters:
sources:
- query: |
LET info_flow_flows = SELECT *
FROM watch_monitoring(artifact="System.Flow.Completion")
WHERE Flow.artifacts_with_results =~ "Generic.Client.Info/BasicInformation"
LET results = SELECT *,
label(client_id=ClientId, labels=Hostname, op="set")
FROM source(artifact="Generic.Client.Info/BasicInformation" ,
client_id=ClientId, flow_id=FlowId)
SELECT * FROM foreach(row=info_flow_flows, query=results)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment