Skip to main content
Question

Stream connector | Elastic events how to get hostgroup

  • February 10, 2025
  • 1 reply
  • 33 views

Forum|alt.badge.img+4

Hello everyone,

I want to add hostgroup name for neb service and host status on my elastic events format using by my stream connector.

 

I've tried several ways but nothing works yet.

 

Do you have an idea for getting a group of hosts?

 

my current working file : 

# cat elastic-events-format.json
{
"neb_host_status": {
"event_type": "host",
"state": "{state}",
"state_type": "{state_type}",
"hostname": "{cache.host.name}",
"output": "{output}",
"notes": "{cache.host.notes}",
"timestamp": "{last_check}"
},
"neb_service_status": {
"event_type": "service",
"state": "{state}",
"state_type": "{state_type}",
"hostname": "{cache.host.name}",
"output": "{output}",
"notes": "{cache.service.notes}",
"service" : "{cache.service.description}",
"hostgroup_name": "{cache.host.group_name}",
"timestamp": "{last_check}"
}
}

 

1 reply

ltirand
Centreonian
Forum|alt.badge.img+10
  • Centreonian
  • March 4, 2025

Hello :)

These documetation pages may help answer your questions: 
Stream connector Elastic Events
Templating documentation
 

From the examples I've been able to find, perhaps a format like this would work: 

‘hostgroups": "{cache.host.hostgroups}",

Hope this may help :)

Kind regards.