###################### Filebeat Configuration #########################
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/filebeat/index.html
#=========================== Filebeat inputs =============================
filebeat.inputs:
# Each - is an input. Most options can be set at the input level, so
# you can use different inputs for various configurations.
# Below are the input specific configurations.
- type: log
# Change to true to enable this input configuration.
enabled: true
# Paths that should be crawled and fetched. Glob based paths.
paths:
- /var/log/myindex-app/*.log
# matching on this type 2022-07-20 10:56:29,393
multiline:
pattern: '^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2},\d{3}'
negate: true
match: after
#============================= Filebeat modules ===============================
filebeat.config.modules:
# Glob pattern for configuration loading
path: ${path.config}/modules.d/*.yml
# Set to true to enable config reloading
reload.enabled: false
# Period on which files under path should be checked for changes
#reload.period: 10s
#==================== Elasticsearch template setting ==========================
setup.template:
#name: "myindex-%{[agent.version]}"
name: "myindex"
pattern: "myindex-*"
#pattern: "myindex-%{[agent.version]}-*"
alias: "myindex"
overwrite: true
settings:
index.number_of_shards: 1
#index.codec: best_compression
#_source.enabled: false
#========================== Modules configuration =============================
filebeat.modules:
#-------------------------------- Nginx Module --------------------------------
- module: nginx
# Access logs
access:
enabled: true
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
var.paths: ["/var/log/nginx/access.log"]
# Input configuration (advanced). Any input configuration option
# can be added under this section.
#input:
# Error logs
error:
enabled: true
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
var.paths: ["/var/log/nginx/error.log"]
# Input configuration (advanced). Any input configuration option
# can be added under this section.
#input:
# Ingress-nginx controller logs. This is disabled by default. It could be used in Kubernetes environments to parse ingress-nginx logs
#ingress_controller:
# enabled: false
#
# # Set custom paths for the log files. If left empty,
# # Filebeat will choose the paths depending on your OS.
# #var.paths:
#================================ Outputs =====================================
# Configure what output to use when sending the data collected by the beat.
# ---------------------------- Elasticsearch Output ----------------------------
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["${ELASTIC_URL}"]
# Protocol - either `http` (default) or `https`.
protocol: "https"
# Certificate for SSL client authentication
# Client Certificate Key
# Authentication credentials - either API key or username/password.
#api_key: "id:api_key"
username: ${ELASTIC_USERNAME}
password: ${ELASTIC_PASSWORD}
# %{[fileset.module]}-%{[fileset.name]} to be added as an option - TBC
#indices:
#index: "myindex-%{[agent.version]}-%{+yyyy.MM.dd}"
index: "myindex"
#index: "myindex-%{[agent.version]}"
: {
"is_write_index": true
}
#setup.ilm:
# enabled: true
# policy_name: "myindex"
# overwrite: true
# rollover_alias: "myindex-%{[agent.version]}"
# pattern: "{now/d}-0000001"
# policy_file: "/usr/share/filebeat/config/myindex.policy.json"
#================================ Processors =====================================
# Configure processors to enhance or manipulate events generated by the beat.
processors:
- add_host_metadata: ~
- add_cloud_metadata: ~
So this config allows filebeat to write to elastic, but it doesn't write the the index that I have named, just to the default. Is there anyone that is able to tell me what I am doing wrong?