-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
template: Add reReplaceAll function #639
Conversation
I made this change from the v0.4.2 tag so submitted the PR against the release-0.4 branch, but not sure if this would be wanted against another (newer) branch. |
This should go against master. This should follow the naming and semantics of Prometheus templates: https://prometheus.io/docs/visualization/template_reference/#strings |
@jamesog can you branch from master and add this change? v0.4.x isn't being supported. |
Yep, will do. I've been sick the last couple of days but I'll get to it ASAP. Can you clarify what you mean about the naming? I was following the example of the |
|
Would |
The naming should be consistent across both. |
Right, but I assume the |
Stick with the regex, if someone has a use case not covered by that we can consider it then. |
This allows for using regexp replacement in templates.
Thanks very much, appreciate the clarification. I've made the change to use |
That's tested now and working as expected. |
Thanks! |
This feature is not included in the latest available release which is obvious but kind of confusing for newbies like me ! |
* Switch to kingpin flags * Fix logrus vendoring * Fix flags in main tests * Fix vendoring versions
This allows for using string replace inside templates.
e.g.: