Skip to content

Commit

Permalink
Add host tags template only for host checks
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianOpeni committed Sep 27, 2024
1 parent c661ba2 commit 468c7d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/perfdata/elasticsearchwriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,10 @@ void ElasticsearchWriter::AddTemplateTags(const Dictionary::Ptr& fields, const C
tie(host, service) = GetHostService(checkable);

Dictionary::Ptr tmpl;
if (service && GetServiceTagsTemplate()) {
tmpl = static_pointer_cast<Dictionary>(GetServiceTagsTemplate()->ShallowClone());
if (service) {
if (GetServiceTagsTemplate()) {
tmpl = static_pointer_cast<Dictionary>(GetServiceTagsTemplate()->ShallowClone());
}
} else if (GetHostTagsTemplate()) {
tmpl = static_pointer_cast<Dictionary>(GetHostTagsTemplate()->ShallowClone());
}
Expand Down

0 comments on commit 468c7d0

Please sign in to comment.