That still doesn't give the IPaddress due to the cider suffix.
Possible Implementation
Add a ipv4, cidr, mac, ipv6, etc key to the addresses dict
Change structure to be easier to write go template for, for e.g. system.interfaces.eth0.addresses.{ipv4, cidr, mac, ipv6, etc}
Make the keys flat, e.g. system_interfaces_eth0_addr_ipv4
Use a library like Sprig, but the template should ideally be straightforward, and this would make it more complicated.
Context
I have a check that needs the host eth0 IP address. I could have it available in a label or annotation, but it would be good to use the information already collected as an entity attribute.
Feature Suggestion
The default
system
entity attribute structure is too complex to get the IP address out when using token substitution. The current structure is:The closest I could come up with is:
That still doesn't give the IPaddress due to the cider suffix.
Possible Implementation
ipv4, cidr, mac, ipv6, etc
key to theaddresses
dictsystem.interfaces.eth0.addresses.{ipv4, cidr, mac, ipv6, etc}
system_interfaces_eth0_addr_ipv4
Sprig
, but the template should ideally be straightforward, and this would make it more complicated.Context
I have a check that needs the host
eth0
IP address. I could have it available in a label or annotation, but it would be good to use the information already collected as an entity attribute.