- Filebeat Reference: other versions:
- Overview
- Getting Started With Filebeat
- Step 1: Install Filebeat
- Step 2: Configure Filebeat
- Step 3: Configure Filebeat to use Logstash
- Step 4: Load the index template in Elasticsearch
- Step 5: Set up the Kibana dashboards
- Step 6: Start Filebeat
- Step 7: View the sample Kibana dashboards
- Quick start: modules for common log formats
- Repositories for APT and YUM
- Setting up and running Filebeat
- Upgrading Filebeat
- How Filebeat works
- Configuring Filebeat
- Specify which modules to run
- Configure inputs
- Manage multiline messages
- Specify general settings
- Load external configuration files
- Configure the internal queue
- Configure the output
- Set up index lifecycle management
- Load balance the output hosts
- Specify SSL settings
- Filter and enhance the exported data
- Parse data by using ingest node
- Enrich events with geoIP information
- Set up project paths
- Set up the Kibana endpoint
- Load the Kibana dashboards
- Load the Elasticsearch index template
- Configure logging
- Use environment variables in the configuration
- Autodiscover
- YAML tips and gotchas
- Regular expression support
- HTTP Endpoint
- filebeat.reference.yml
- Beats central management
- Modules
- Exported fields
- Alias fields
- Apache2 fields
- Auditd fields
- Beat fields
- Cloud provider metadata fields
- Docker fields
- elasticsearch fields
- haproxy fields
- Host fields
- Icinga fields
- IIS fields
- Kafka fields
- kibana fields
- Kubernetes fields
- Log file content fields
- logstash fields
- mongodb fields
- MySQL fields
- Nginx fields
- Osquery fields
- PostgreSQL fields
- Redis fields
- System fields
- Traefik fields
- Monitoring Filebeat
- Securing Filebeat
- Troubleshooting
- Migrating from Logstash Forwarder to Filebeat
- Contributing to Beats
Secrets keystore for secure settings
editSecrets keystore for secure settings
editWhen you configure Filebeat, you might need to specify sensitive settings, such as passwords. Rather than relying on file system permissions to protect these values, you can use the Filebeat keystore to securely store secret values for use in configuration settings.
After adding a key and its secret value to the keystore, you can use the key in place of the secret value when you configure sensitive settings.
The syntax for referencing keys is identical to the syntax for environment variables:
${KEY}
Where KEY is the name of the key.
For example, imagine that the keystore contains a key called ES_PWD
with the
value yourelasticsearchpassword
:
-
In the configuration file, use
output.elasticsearch.password: "${ES_PWD}"
-
On the command line, use:
-E "output.elasticsearch.password=\${ES_PWD}"
When Filebeat unpacks the configuration, it resolves keys before resolving environment variables and other variables.
Notice that the Filebeat keystore differs from the Elasticsearch keystore.
Whereas the Elasticsearch keystore lets you store elasticsearch.yml
values by
name, the Filebeat keystore lets you specify arbitrary names that you can
reference in the Filebeat configuration.
To create and manage keys, use the keystore
command. See the
command reference for the full command syntax, including
optional flags.
The keystore
command must be run by the same user who will run
Filebeat.
Create a keystore
editTo create a secrets keystore, use:
filebeat keystore create
Filebeat creates the keystore in the directory defined by the path.config
configuration setting.
Add keys
editTo store sensitive values, such as authentication credentials for Elasticsearch,
use the keystore add
command:
filebeat keystore add ES_PWD
When prompted, enter a value for the key.
To overwrite an existing key’s value, use the --force
flag:
filebeat keystore add ES_PWD --force
To pass the value through stdin, use the --stdin
flag. You can also use
--force
:
cat /file/containing/setting/value | filebeat keystore add ES_PWD --stdin --force
List keys
editTo list the keys defined in the keystore, use:
filebeat keystore list
Remove keys
editTo remove a key from the keystore, use:
filebeat keystore remove ES_PWD
On this page