filebeat 7.9.3更改索引不起作用,它总是创建默认的filebeat-7.9.3-2020.11.04-000001

fjaof16o  于 2021-06-10  发布在  ElasticSearch
关注(0)|答案(1)|浏览(414)

我试过了https://www.elastic.co/guide/en/beats/filebeat/master//change-index-name.html#change-索引名称和https://discuss.elastic.co/t/index-management-change-index-name-in-filebeat/202876
在windows环境下使用filebeat-7.9.3和kibana-7.9.2,但是在kibana中它没有创建我在filebeat.yml中提到的索引名


# ============================== Filebeat inputs ===============================

filebeat.inputs:
- type: log
    - C:\FREESOFT\myfilebeatlogs\*

# ============================== 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

# ======================= Elasticsearch template setting =======================

setup.template.settings:
  index.number_of_shards: 1
  #index.codec: best_compression
  #_source.enabled: false

# ================================== 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: ["localhost:9200"]
index: "customindexname-%{+yyyy.MM.dd}"

我也试过了

index: "myindexname-%{+yyyy.MM.dd}"
setup.template.enabled: false
setup.template.name: "myindexname"
setup.template.pattern: "myindexname-*"

请帮助我这个,我想创建一个自定义索引,并插入数据到它从filebeat。过去的问题并没有解决我的问题。

mf98qq94

mf98qq941#

下面的配置为我工作,并创建一个我想要的索引名

filebeat.inputs:
  - type: log
    paths:
      - "/var/log/*.log"
setup.ilm.enabled: false
setup.template.overwrite: true
output.elasticsearch:
  hosts: ["<my-es-host>"]
  index: "foo-%{+yyyy.MM}"
  username: '${ELASTICSEARCH_USERNAME:elastic}'
  password: '${ELASTICSEARCH_PASSWORD:elastic}'

setup.template:
  name: 'foo'
  pattern: 'foo-*'
  enabled: false

相关问题