在Debian上配置Filebeat的API密钥,可参考以下步骤:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
,echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
,sudo apt-get update
,sudo apt-get install -y filebeat
。POST /_security/api_key
,并指定名称和角色描述符,获取类似{"id":"id","name":"name","api_key":"api_key"}
的返回值。/etc/filebeat/filebeat.yml
文件,在output.elasticsearch
部分添加api_key
配置,格式为id:api_key
,例如output.elasticsearch: hosts: ["localhost:9200"] api_key: TiNAGG4BaaMdaH1tRfuU:KnR6yE41RrSowb0kQ0HWoA
。