Skip to content

Commit

Permalink
[Elasticsearch] Add condition and leader election to Elasticsearch in…
Browse files Browse the repository at this point in the history
…tegration (elastic#5353)

* Add condition and leader election to elasticsearch integration

* Update changelog link

* Update condition description wording
  • Loading branch information
BenB196 authored and agithomas committed Mar 20, 2023
1 parent a7e9153 commit c775da6
Show file tree
Hide file tree
Showing 18 changed files with 168 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/elasticsearch/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# newer versions go on top
- version: "1.3.0"
changes:
- description: Add conditional support to Elasticsearch log and metrics inputs
type: enhancement
link: https://github.com/elastic/integrations/issues/5353
- description: Add leader election support to Elasticsearch inputs metrics inputs
type: enhancement
link: https://github.com/elastic/integrations/issues/5353
- version: "1.2.0"
changes:
- description: Add period variable to define polling frequency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ paths:
{{#each paths as |path i|}}
- {{path}}
{{/each}}
{{#if condition}}
condition: {{ condition }}
{{/if}}
exclude_files: [".gz$"]
processors:
- add_locale: ~
Expand Down
11 changes: 11 additions & 0 deletions packages/elasticsearch/data_stream/ccr/agent/stream/stream.yml.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@ password: {{password}}
period: {{period}}
{{#if ssl}}
ssl: {{ssl}}
{{/if}}
{{#if leaderelection }}
{{#if condition }}
condition: ${kubernetes_leaderelection.leader} == true and {{ condition }}
{{ else }}
condition: ${kubernetes_leaderelection.leader} == true
{{/if}}
{{ else }}
{{#if condition }}
condition: {{ condition }}
{{/if}}
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@ password: {{password}}
period: {{period}}
{{#if ssl}}
ssl: {{ssl}}
{{/if}}
{{#if leaderelection }}
{{#if condition }}
condition: ${kubernetes_leaderelection.leader} == true and {{ condition }}
{{ else }}
condition: ${kubernetes_leaderelection.leader} == true
{{/if}}
{{ else }}
{{#if condition }}
condition: {{ condition }}
{{/if}}
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ paths:
{{#each paths as |path i|}}
- {{path}}
{{/each}}
{{#if condition}}
condition: {{ condition }}
{{/if}}
exclude_files: [".gz$","_slowlog.log$","_access.log$"]
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@ password: {{password}}
period: {{period}}
{{#if ssl}}
ssl: {{ssl}}
{{/if}}
{{#if leaderelection }}
{{#if condition }}
condition: ${kubernetes_leaderelection.leader} == true and {{ condition }}
{{ else }}
condition: ${kubernetes_leaderelection.leader} == true
{{/if}}
{{ else }}
{{#if condition }}
condition: {{ condition }}
{{/if}}
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ paths:
{{#each paths as |path i|}}
- {{path}}
{{/each}}
{{#if condition}}
condition: {{ condition }}
{{/if}}
exclude_files: [".gz$"]
exclude_lines: ["^(OpenJDK|Java HotSpot).* Server VM ", "^CommandLine flags: ", "^Memory: ", "^{"] # exclude JVM8 banner and JSON
multiline:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@ password: {{password}}
period: {{period}}
{{#if ssl}}
ssl: {{ssl}}
{{/if}}
{{#if leaderelection }}
{{#if condition }}
condition: ${kubernetes_leaderelection.leader} == true and {{ condition }}
{{ else }}
condition: ${kubernetes_leaderelection.leader} == true
{{/if}}
{{ else }}
{{#if condition }}
condition: {{ condition }}
{{/if}}
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@ password: {{password}}
period: {{period}}
{{#if ssl}}
ssl: {{ssl}}
{{/if}}
{{#if leaderelection }}
{{#if condition }}
condition: ${kubernetes_leaderelection.leader} == true and {{ condition }}
{{ else }}
condition: ${kubernetes_leaderelection.leader} == true
{{/if}}
{{ else }}
{{#if condition }}
condition: {{ condition }}
{{/if}}
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@ password: {{password}}
period: {{period}}
{{#if ssl}}
ssl: {{ssl}}
{{/if}}
{{#if leaderelection }}
{{#if condition }}
condition: ${kubernetes_leaderelection.leader} == true and {{ condition }}
{{ else }}
condition: ${kubernetes_leaderelection.leader} == true
{{/if}}
{{ else }}
{{#if condition }}
condition: {{ condition }}
{{/if}}
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@ password: {{password}}
period: {{period}}
{{#if ssl}}
ssl: {{ssl}}
{{/if}}
{{#if leaderelection }}
{{#if condition }}
condition: ${kubernetes_leaderelection.leader} == true and {{ condition }}
{{ else }}
condition: ${kubernetes_leaderelection.leader} == true
{{/if}}
{{ else }}
{{#if condition }}
condition: {{ condition }}
{{/if}}
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@ password: {{password}}
period: {{period}}
{{#if ssl}}
ssl: {{ssl}}
{{/if}}
{{#if leaderelection }}
{{#if condition }}
condition: ${kubernetes_leaderelection.leader} == true and {{ condition }}
{{ else }}
condition: ${kubernetes_leaderelection.leader} == true
{{/if}}
{{ else }}
{{#if condition }}
condition: {{ condition }}
{{/if}}
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@ password: {{password}}
period: {{period}}
{{#if ssl}}
ssl: {{ssl}}
{{/if}}
{{#if leaderelection }}
{{#if condition }}
condition: ${kubernetes_leaderelection.leader} == true and {{ condition }}
{{ else }}
condition: ${kubernetes_leaderelection.leader} == true
{{/if}}
{{ else }}
{{#if condition }}
condition: {{ condition }}
{{/if}}
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@ password: {{password}}
period: {{period}}
{{#if ssl}}
ssl: {{ssl}}
{{/if}}
{{#if leaderelection }}
{{#if condition }}
condition: ${kubernetes_leaderelection.leader} == true and {{ condition }}
{{ else }}
condition: ${kubernetes_leaderelection.leader} == true
{{/if}}
{{ else }}
{{#if condition }}
condition: {{ condition }}
{{/if}}
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ paths:
{{#each paths as |path i|}}
- {{path}}
{{/each}}
{{#if condition}}
condition: {{ condition }}
{{/if}}
exclude_files: [".gz$","_slowlog.log$","_access.log$","_deprecation.log$"]
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@ password: {{password}}
period: {{period}}
{{#if ssl}}
ssl: {{ssl}}
{{/if}}
{{#if leaderelection }}
{{#if condition }}
condition: ${kubernetes_leaderelection.leader} == true and {{ condition }}
{{ else }}
condition: ${kubernetes_leaderelection.leader} == true
{{/if}}
{{ else }}
{{#if condition }}
condition: {{ condition }}
{{/if}}
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ paths:
{{#each paths as |path i|}}
- {{path}}
{{/each}}
{{#if condition}}
condition: {{ condition }}
{{/if}}
exclude_files: [".gz$"]
25 changes: 24 additions & 1 deletion packages/elasticsearch/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: elasticsearch
title: Elasticsearch
version: 1.2.0
version: 1.3.0
description: Elasticsearch Integration
type: integration
icons:
Expand All @@ -21,6 +21,14 @@ policy_templates:
- type: logfile
title: Collect Elasticsearch logs
description: "Collecting audit, deprecation, gc, server and slowlog logs from Elasticsearch instances (input: logfile)"
vars:
- name: condition
title: Condition
description: Condition to filter when to collect this input
type: text
multi: false
required: false
show_user: false
- type: elasticsearch/metrics
title: Collect Elasticsearch metrics
description: Collect Elasticsearch metrics about indices, CCR, cluster stats, machine learning or node statistics
Expand Down Expand Up @@ -67,5 +75,20 @@ policy_templates:
#certificate_authorities: ["/etc/ca.crt"]
#certificate: "/etc/client.crt"
#key: "/etc/client.key"
- name: leaderelection
type: bool
title: Leader Election
description: Enable leaderelection between a set of Elastic Agents running on Kubernetes. Useful for when scope is `cluster`.
multi: false
required: true
show_user: false
default: false
- name: condition
title: Condition
description: Condition to filter when to collect this input
type: text
multi: false
required: false
show_user: false
owner:
github: elastic/infra-monitoring-ui

0 comments on commit c775da6

Please sign in to comment.