Hi @star_board ,
Something like this should work for your use case, utilizing the Starlark processor @nickH mentioned.
[[outputs.influxdb_v2]]
urls = ["https://127.0.0.1/influxdb"]
token = "eaN73XZ4kWNzTwqkzWrhJpcH2ZJsZjkzuRwOPl-fe0cNMrMrg-2yRoJQvMYpnMVzBxLa8GN6EcXx42JEnEU2w="
organization = "boschrexroth"
bucket = "boschrexroth"
insecure_skip_verify = true
## Configure the input plugin with the username and password to ctrlX Core
[[inputs.ctrlx_datalayer]]
server = "localhost"
## Authentication credentials
username = "boschrexroth"
password = "boschrexroth"
## Use TLS but skip chain & host verification
insecure_skip_verify = true
[[inputs.ctrlx_datalayer.subscription]]
measurement = "metrics"
nodes=[
{name="cpu_usage_percent", address="framework/metrics/system/cpu-utilisation-percent"},
{name ="timestamp",address="system/info/time"}
]
## The switch "output_json_string" enables output of the measurement as json.
## That way it can be used in in a subsequent processor plugin, e.g. "Starlark Processor Plugin".
output_json_string = false
[[processors.starlark]]
source = '''
load("logging.star","log")
def apply(metric):
log.error("----------------------")
log.error(metric.tags['node'])
if "timestamp" in metric.fields:
log.error("Timestamp old: " + str(metric.time))
metric.time = metric.fields['timestamp']
log.error("Timestamp new: " + str(metric.time))
return metric
'''
In the starlark processor, you would look for your PLCTimeStamp field and set the metric.time to that value. Here I used the time coming from the ctrlX system.
... View more