I’m currently using {host.name} in the Event Template title in Events Extraction, but I’m noticing that {hostname} and {host.hostname} do not fill and remain as such in the Problem when it generates. Unsure if this is related.
Is there a way to get the shortened hostname into a variable for these fields please?
@i_g Sorry, you are right, but interestingly when you look at the dt.event.title in the event details on the host it does show the updated name but this does not get passed on to the problem :grinning_face_with_smiling_eyes:
Hi,
you can try use custom metadata/kubernetes annotation.
I mean you have two option:
in Kubernetes: add an annotation to pod with the short name, e.g., short-hostname=web01 (on the node/pod—wherever you want to read it). Dynatrace ingests such metadata, so you can reference it in tags/naming rules
In Non-K8s hosts: set custom host metadata/tag via OneAgent, e.g.
oneagentctl --set-host-property ShortHostname=web01 (or a tag ShortHostname=web01).
Then use that metadata (e.g., {ShortHostname}) in your naming/template instead of {host.name}.
Second option is transform {host.name} with a regex. You already send this example