One could use the following code in rule/rulefunction and then use $hostName in XPATH mapper. (attached sample)
===
Object localHost = System.execJava("java.net.InetAddress", "getLocalHost", null, null, null);
Object hostName = System.execJava("java.net.InetAddress", "getHostName",null, localHost, null);
System.debugOut("#### Machine name is " + hostName);
System.debugOut("##### Machine name is " + hostName + " localhost=" + localHost);
====
Alternatively, you could create your custom java function in BE with something similar and reuse in multiple rules/rule functions. Please refer to :- https://docs.tibco.com/pub/businessevents-enterprise/5.5.0/doc/pdf/TIB_businessevents-standard_5.5_developers_guide.pdf?id=7