Skip to content

Commit

Permalink
[automation] Publish kubernetes templates for elastic-agent (#1192)
Browse files Browse the repository at this point in the history
Co-authored-by: apmmachine <infra-root+apmmachine@elastic.co>
  • Loading branch information
elasticmachine and apmmachine authored Sep 14, 2022
1 parent 8b711f3 commit ae2c942
Show file tree
Hide file tree
Showing 60 changed files with 15,252 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
inputs:
- name: activemq/metrics-activemq
type: activemq/metrics
use_output: default
streams:
- condition: ${kubernetes.hints.activemq.broker.enabled} == true or ${kubernetes.hints.activemq.enabled} == true
data_stream:
dataset: activemq.broker
type: metrics
hosts:
- ${kubernetes.hints.activemq.broker.host|'localhost:8161'}
metricsets:
- broker
password: ${kubernetes.hints.activemq.broker.password|'admin'}
path: /api/jolokia/?ignoreErrors=true&amp;canonicalNaming=false
period: ${kubernetes.hints.activemq.broker.period|'10s'}
tags:
- forwarded
- activemq-broker
username: ${kubernetes.hints.activemq.broker.username|'admin'}
- condition: ${kubernetes.hints.activemq.queue.enabled} == true or ${kubernetes.hints.activemq.enabled} == true
data_stream:
dataset: activemq.queue
type: metrics
hosts:
- ${kubernetes.hints.activemq.queue.host|'localhost:8161'}
metricsets:
- queue
password: ${kubernetes.hints.activemq.queue.password|'admin'}
path: /api/jolokia/?ignoreErrors=true&amp;canonicalNaming=false
period: ${kubernetes.hints.activemq.queue.period|'10s'}
tags:
- forwarded
- activemq-queue
username: ${kubernetes.hints.activemq.queue.username|'admin'}
- condition: ${kubernetes.hints.activemq.topic.enabled} == true or ${kubernetes.hints.activemq.enabled} == true
data_stream:
dataset: activemq.topic
type: metrics
hosts:
- ${kubernetes.hints.activemq.topic.host|'localhost:8161'}
metricsets:
- topic
password: ${kubernetes.hints.activemq.topic.password|'admin'}
path: /api/jolokia/?ignoreErrors=true&amp;canonicalNaming=false
period: ${kubernetes.hints.activemq.topic.period|'10s'}
tags:
- forwarded
- activemq-topic
username: ${kubernetes.hints.activemq.topic.username|'admin'}
data_stream.namespace: default
- name: filestream-activemq
type: filestream
use_output: default
streams:
- condition: ${kubernetes.hints.activemq.audit.enabled} == true or ${kubernetes.hints.activemq.enabled} == true
data_stream:
dataset: activemq.audit
type: logs
exclude_files:
- .gz$
parsers:
- container:
format: auto
stream: ${kubernetes.hints.activemq.audit.stream|'all'}
paths:
- /var/log/containers/*${kubernetes.hints.container_id}.log
prospector:
scanner:
symlinks: true
tags:
- forwarded
- activemq-audit
- condition: ${kubernetes.hints.activemq.log.enabled} == true or ${kubernetes.hints.activemq.enabled} == true
data_stream:
dataset: activemq.log
type: logs
exclude_files:
- .gz$
multiline:
match: after
negate: true
pattern: '^\d{4}-\d{2}-\d{2} '
parsers:
- container:
format: auto
stream: ${kubernetes.hints.activemq.log.stream|'all'}
paths:
- /var/log/containers/*${kubernetes.hints.container_id}.log
prospector:
scanner:
symlinks: true
tags:
- forwarded
- activemq-log
data_stream.namespace: default
134 changes: 134 additions & 0 deletions deploy/kubernetes/elastic-agent-standalone/templates.d/apache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
inputs:
- name: apache/metrics-apache
type: apache/metrics
use_output: default
streams:
- condition: ${kubernetes.hints.apache.status.enabled} == true or ${kubernetes.hints.apache.enabled} == true
data_stream:
dataset: apache.status
type: metrics
hosts:
- ${kubernetes.hints.apache.status.host|'http://127.0.0.1'}
metricsets:
- status
period: ${kubernetes.hints.apache.status.period|'30s'}
server_status_path: /server-status
data_stream.namespace: default
- name: filestream-apache
type: filestream
use_output: default
streams:
- condition: ${kubernetes.hints.apache.access.enabled} == true or ${kubernetes.hints.apache.enabled} == true
data_stream:
dataset: apache.access
type: logs
exclude_files:
- .gz$
parsers:
- container:
format: auto
stream: ${kubernetes.hints.apache.access.stream|'all'}
paths:
- /var/log/containers/*${kubernetes.hints.container_id}.log
prospector:
scanner:
symlinks: true
tags:
- apache-access
- condition: ${kubernetes.hints.apache.error.enabled} == true or ${kubernetes.hints.apache.enabled} == true
data_stream:
dataset: apache.error
type: logs
exclude_files:
- .gz$
parsers:
- container:
format: auto
stream: ${kubernetes.hints.apache.error.stream|'all'}
paths:
- /var/log/containers/*${kubernetes.hints.container_id}.log
processors:
- add_locale: null
prospector:
scanner:
symlinks: true
tags:
- apache-error
data_stream.namespace: default
- name: httpjson-apache
type: httpjson
use_output: default
streams:
- condition: ${kubernetes.hints.apache.access.enabled} == true and ${kubernetes.hints.apache.enabled} == true
config_version: "2"
cursor:
index_earliest:
value: '[[.last_event.result.max_indextime]]'
data_stream:
dataset: apache.access
type: logs
interval: 10s
request.method: POST
request.transforms:
- set:
target: url.params.search
value: search sourcetype="access*" | streamstats max(_indextime) AS max_indextime
- set:
target: url.params.output_mode
value: json
- set:
default: '[[(now (parseDuration "-10s")).Unix]]'
target: url.params.index_earliest
value: '[[ .cursor.index_earliest ]]'
- set:
target: url.params.index_latest
value: '[[(now).Unix]]'
- set:
target: header.Content-Type
value: application/x-www-form-urlencoded
request.url: https://server.example.com:8089/services/search/jobs/export
response.decode_as: application/x-ndjson
response.split:
delimiter: |4+
target: body.result._raw
type: string
tags:
- forwarded
- apache-access
- condition: ${kubernetes.hints.apache.error.enabled} == true and ${kubernetes.hints.apache.enabled} == true
config_version: 2
cursor:
index_earliest:
value: '[[.last_event.result.max_indextime]]'
data_stream:
dataset: apache.error
type: logs
interval: 10s
request.method: POST
request.transforms:
- set:
target: url.params.search
value: search sourcetype=apache:error OR sourcetype=apache_error | streamstats max(_indextime) AS max_indextime
- set:
target: url.params.output_mode
value: json
- set:
default: '[[(now (parseDuration "-10s")).Unix]]'
target: url.params.index_earliest
value: '[[ .cursor.index_earliest ]]'
- set:
target: url.params.index_latest
value: '[[(now).Unix]]'
- set:
target: header.Content-Type
value: application/x-www-form-urlencoded
request.url: https://server.example.com:8089/services/search/jobs/export
response.decode_as: application/x-ndjson
response.split:
delimiter: |4+
target: body.result._raw
type: string
tags:
- forwarded
- apache-error
data_stream.namespace: default
Loading

0 comments on commit ae2c942

Please sign in to comment.