Brine, so thank you for your help! It works perfectly and it's absolutely 
the same, what I want to see!


среда, 27 мая 2020 г., 12:22:59 UTC+3 пользователь Brian Candler написал:
>
> On Wednesday, 27 May 2020 09:07:05 UTC+1, Anna Chekhovskikh wrote:
>>
>> I checked your solution, it works, but I need to strip off all _before_ 
>> last slash.
>>
>
> - source_labels: [__address__]
>   regex: '.*/(.*)'
>   replacement: '$1'     # this is the default anyway
>   target_label: store
>
> The regular expression "captures" sections in parentheses.  $1 is the 
> first parenthesised subexpression, $2 is the second etc.  So it could also 
> be written:
>
> - source_labels: [__address__]
>   regex: '(.*)/(.*)'
>   replacement: '$2'
>   target_label: store
>
> Regexps are "greedy" by default, so aaa/bbb/ccc will be matched as 
> (aaa/bbb) / (ccc) 
>
>
> And if I change your regex to mine, I can't see the new label.
>>
>>
> You'll need to show your regex, and an example of the input you're trying 
> to match against it, and what you would like to see as the output.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/631e8354-b33b-4a6a-a2d4-dec39b761b4a%40googlegroups.com.

Reply via email to