Page MenuHomeVyOS Platform

Telegraf configuration doesn't accept IPs for URL
Closed, ResolvedPublicBUG

Description

The new Telegraf configuration in 1.3.1 has invalid regex for the url field that does not accept IP addresses.

My custom telegraf config that I am trying to migrate from has urls = ["http://10.0.0.4:8086"] which is fully functional and accepted by Telegraf, but the regex for the new configuration does not accept IP addresses and only accepts domain names.

Invalid regex is viewable here: https://github.com/vyos/vyos-1x/blob/equuleus/interface-definitions/service_monitoring_telegraf.xml.in#L96

Details

Difficulty level
Easy (less than an hour)
Version
1.3.1
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Related Objects

Mentioned In
1.3.3

Event Timeline

After some testing in regex101, it seems like a good replacement regex would be ^(http:\/\/|https:\/\/)?[a-z0-9]+(?:[\-\.]{1}[a-z0-9]+)*(\/.*)?$ but I'm not well versed enough to build an image off of my own branch to test that, and I can't figure out how to modify the installed version to use the new regex to test.

If anyone can point me to a guide for running the docker build against a fork of the repo I'd be happy to test it, otherwise I'm not sure how to test the fix.

Viacheslav changed the task status from Open to In progress.Oct 13 2022, 9:01 AM
Viacheslav claimed this task.
Viacheslav added a project: VyOS 1.4 Sagitta.