Diederik
09/24/2024, 7:32 PMinput:
opcua:
endpoint: 'opc.tcp://192.168.2.101:4840'
nodeIDs: ['ns=3;s="DB_00CommunicationDayResults"','ns=3;s="DB_00CommunicationMachineStatus"']
subscribeEnabled: true
pipeline:
processors:
- bloblang: |
let folder = if meta("opcua_path").contains("DB_00CommunicationDayResults") {
"DayResults"
} else if meta("opcua_path").contains("DB_00CommunicationMachineStatus") {
"MachineStatus"
} else {
"unknown"
}
meta folder = folder
root = {
meta("opcua_path"): this,
"timestamp_ms": (timestamp_unix_nano() / 1000000).floor()
}
output:
mqtt:
urls:
- tcp://192.168.2.31:1883
topic: 'umh/v1/TLT/Muzzroom/Meulebekestraat/ProductionLine1/SortingUnit1/originID/_historian/${!meta("folder")}/${!meta("opcua_tag_group")}/${!meta("opcua_tag_name")}'
client_id: 'benthos-umh'Ferdinand
09/25/2024, 7:29 AMthis.cleaned_tags appears nowhere in your config.
So the only access is when you assign to root.
You can probably copy a bit of code from our kafka to historian (once it is live in a couple of hours) custom data flow component template, on how to handle unexpected values 🙂