Skip to content
Snippets Groups Projects
Commit c37092fb authored by jurgenhaas's avatar jurgenhaas
Browse files

Add support to output to elasticsearch and openobserve in parallel

parent b2eca526
No related branches found
No related tags found
No related merge requests found
......@@ -274,8 +274,12 @@
{% for appl in hostvars[host].fluentd_applications|default([]) %}
{% if appl.type|default(false) %}
<match {{ appl.index }}>
@type {% if elasticsearch_install|default('yes') %}{{ appl.plugin|default('elasticsearch') }}{% else %}http{% endif %}
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
@type copy
<store>
{% endif %}
{% if elasticsearch_install|default('yes') %}
@type {{ appl.plugin|default('elasticsearch') }}
host 127.0.0.1
port 9200
include_tag_key true
......@@ -288,7 +292,12 @@
{% if appl.plugin|default('elasticsearch') == 'elasticsearch' %}
reconnect_on_error true
{% endif %}
{% else %}
{% endif %}
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
</store>
<store>
{% endif %}
{% if fluentd_openobserve_backend is defined %}
@type http
endpoint https://{{ fluentd_openobserve_backend.domain }}/api/default/{{ appl.index }}/_json
content_type json
......@@ -298,6 +307,9 @@
username {{ fluentd_openobserve_backend.username }}
password {{ fluentd_openobserve_backend.password }}
</auth>
{% endif %}
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
</store>
{% endif %}
<buffer>
@type file
......@@ -311,6 +323,10 @@
{% endfor %}
<match app.ansible>
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
@type copy
<store>
{% endif %}
{% if elasticsearch_install|default('yes') %}
@type elasticsearch
host 127.0.0.1
......@@ -322,7 +338,12 @@
index_name ansible
type_name ansible
reconnect_on_error true
{% else %}
{% endif %}
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
</store>
<store>
{% endif %}
{% if fluentd_openobserve_backend is defined %}
@type http
endpoint https://{{ fluentd_openobserve_backend.domain }}/api/default/ansible/_json
content_type json
......@@ -332,6 +353,9 @@
username {{ fluentd_openobserve_backend.username }}
password {{ fluentd_openobserve_backend.password }}
</auth>
{% endif %}
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
</store>
{% endif %}
<buffer>
@type file
......@@ -343,6 +367,10 @@
</match>
<match app.uptime.ping>
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
@type copy
<store>
{% endif %}
{% if elasticsearch_install|default('yes') %}
@type elasticsearch
host 127.0.0.1
......@@ -354,7 +382,12 @@
index_name uptime
type_name ping
reconnect_on_error true
{% else %}
{% endif %}
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
</store>
<store>
{% endif %}
{% if fluentd_openobserve_backend is defined %}
@type http
endpoint https://{{ fluentd_openobserve_backend.domain }}/api/default/uptime/_json
content_type json
......@@ -364,6 +397,9 @@
username {{ fluentd_openobserve_backend.username }}
password {{ fluentd_openobserve_backend.password }}
</auth>
{% endif %}
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
</store>
{% endif %}
<buffer>
@type file
......@@ -375,6 +411,10 @@
</match>
<match haproxy.*>
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
@type copy
<store>
{% endif %}
{% if elasticsearch_install|default('yes') %}
@type elasticsearch
host 127.0.0.1
......@@ -386,7 +426,12 @@
index_name haproxy
type_name haproxy
reconnect_on_error true
{% else %}
{% endif %}
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
</store>
<store>
{% endif %}
{% if fluentd_openobserve_backend is defined %}
@type http
endpoint https://{{ fluentd_openobserve_backend.domain }}/api/default/haproxy/_json
content_type json
......@@ -396,6 +441,9 @@
username {{ fluentd_openobserve_backend.username }}
password {{ fluentd_openobserve_backend.password }}
</auth>
{% endif %}
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
</store>
{% endif %}
<buffer>
@type file
......@@ -407,6 +455,10 @@
</match>
<match *beat>
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
@type copy
<store>
{% endif %}
{% if elasticsearch_install|default('yes') %}
@type elasticsearch_dynamic
logstash_format true
......@@ -419,7 +471,12 @@
include_tag_key true
tag_key @log_name
reconnect_on_error true
{% else %}
{% endif %}
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
</store>
<store>
{% endif %}
{% if fluentd_openobserve_backend is defined %}
@type http
endpoint https://{{ fluentd_openobserve_backend.domain }}/api/default/beat/_json
content_type json
......@@ -429,6 +486,9 @@
username {{ fluentd_openobserve_backend.username }}
password {{ fluentd_openobserve_backend.password }}
</auth>
{% endif %}
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
</store>
{% endif %}
<buffer>
@type file
......@@ -440,6 +500,10 @@
</match>
<match netdata>
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
@type copy
<store>
{% endif %}
{% if elasticsearch_install|default('yes') %}
@type elasticsearch
host 127.0.0.1
......@@ -451,7 +515,12 @@
index_name netdata
type_name netdata
reconnect_on_error true
{% else %}
{% endif %}
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
</store>
<store>
{% endif %}
{% if fluentd_openobserve_backend is defined %}
@type http
endpoint https://{{ fluentd_openobserve_backend.domain }}/api/default/netdata/_json
content_type json
......@@ -461,6 +530,9 @@
username {{ fluentd_openobserve_backend.username }}
password {{ fluentd_openobserve_backend.password }}
</auth>
{% endif %}
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
</store>
{% endif %}
<buffer>
@type file
......@@ -475,6 +547,10 @@
</match>
<match **>
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
@type copy
<store>
{% endif %}
{% if elasticsearch_install|default('yes') %}
@type elasticsearch
logstash_format true
......@@ -487,7 +563,12 @@
index_name fluentd
type_name fluentd
reconnect_on_error true
{% else %}
{% endif %}
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
</store>
<store>
{% endif %}
{% if fluentd_openobserve_backend is defined %}
@type http
endpoint https://{{ fluentd_openobserve_backend.domain }}/api/default/default/_json
content_type json
......@@ -497,6 +578,9 @@
username {{ fluentd_openobserve_backend.username }}
password {{ fluentd_openobserve_backend.password }}
</auth>
{% endif %}
{% if elasticsearch_install|default('yes') and fluentd_openobserve_backend is defined %}
</store>
{% endif %}
<buffer>
@type file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment