elasticsearch 未在Filebeat中将索引名设置为Elasticsearch-ELK.NET Docker ElasticHQ,elasticsearch,docker-compose,filebeat,elasticsearch,Docker Compose,Filebeat" /> elasticsearch 未在Filebeat中将索引名设置为Elasticsearch-ELK.NET Docker ElasticHQ,elasticsearch,docker-compose,filebeat,elasticsearch,Docker Compose,Filebeat" />

elasticsearch 未在Filebeat中将索引名设置为Elasticsearch-ELK.NET Docker ElasticHQ

elasticsearch 未在Filebeat中将索引名设置为Elasticsearch-ELK.NET Docker ElasticHQ,elasticsearch,docker-compose,filebeat,elasticsearch,Docker Compose,Filebeat,我正在试验一些按照Elasticsearch格式化的json,因此我直接从Filebeat转到Elasticsearch,而不是通过Logstash。这是使用docker compose: version: '2.2' services: elasticsearch: container_name: elasticsearch image: docker.elastic.co/elasticsearch/elasticsearch:7.5.2 ports:

我正在试验一些按照
Elasticsearch
格式化的
json
,因此我直接从
Filebeat
转到Elasticsearch,而不是通过
Logstash
。这是使用
docker compose

version: '2.2'
services:
  elasticsearch:
    container_name: elasticsearch
    image: docker.elastic.co/elasticsearch/elasticsearch:7.5.2
    ports:
      - 9200:9200
      - 9300:9300
    environment:
      - discovery.type=single-node
      - cluster.name=docker-
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    networks:
      - esnet
  filebeat:
    container_name: filebeat
    build:
      context: .
      dockerfile: filebeat.Dockerfile
    volumes:
      - ./logs:/var/log
      - ./filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml
    networks:
      - esnet  
  elastichq:
    container_name: elastichq
    image: elastichq/elasticsearch-hq
    ports:
      - 8080:5000
    environment:
      - HQ_DEFAULT_URL=http://elasticsearch:9200
      - HQ_ENABLE_SSL=False
      - HQ_DEBUG=FALSE
    networks:
      - esnet  
networks:
  esnet: 
但是,当我打开
ElasticHQ
时,索引名称已被标记为带有日期戳的
filebeat-7.5.2-2020.02.10-000001
。我已在我的
filebeat.yml
中将
索引
名称指定为
Sample
。我有没有遗漏什么,或者这种行为正常吗

这是我的
filebeat.yml

filebeat.inputs:
- type: log
  enabled: true
  paths:
    - /var/log/*.json
  json.keys_under_root: true
  json.add_error_key: true 

#----------------------------- Elasticsearch output --------------------------------

output.elasticsearch:
  hosts: ["elasticsearch:9200"]
  index: "sample-%{+YYYY.MM.dd}"


setup.template.name: "sample"
setup.template.pattern: "sample-*"
如果我使用Postman而不是ElasticHQ,那么了解一些预定义的内容会更实际,这样我就可以开始查询我的数据,而无需查找
索引
名称。

我认为可能会取代配置的索引名称

从7.0版开始,Filebeat使用索引生命周期管理 默认情况下,它连接到支持生命周期的群集 经营Filebeat自动加载默认策略并 将其应用于Filebeat创建的任何索引

启用ilm时,将忽略文件节拍索引设置

启用索引生命周期管理时,将忽略索引设置 启用。如果要将事件发送到支持索引的群集 生命周期管理,请参阅将索引生命周期管理配置为 了解如何更改索引名称

您可能需要禁用ILM,或者最好使用ILM rollover\u别名配置所需的文件名