How to change elasticsearch output index with default template

(George) #1

Hello, checked the documents, i am still not able to update elasticsearch output index. i want to add a log type on it. But it keeps giving me the default one.
Here is my conf,


- type: log

  # change to true to enable this input configuration.
  enabled: true

  # paths that should be crawled and fetched. glob based paths.
    - /users/george/downloads/jslog1.log

  json.keys_under_root: true
  json.add_error_key: true
  json.message_key: log
    #- c:\programdata\elasticsearch\logs\*

   level: debug
   review: 1
   log_type: nodeerror


  # glob pattern for configuration loading
  path: ${path.config}/modules.d/*.yml

  # set to true to enable config reloading
  reload.enabled: false

#==================== elasticsearch template setting ========================== "filebeat"
setup.template.pattern: "filebeat-*"
  index.number_of_shards: 1

  # array of hosts to connect to.
  hosts: ["localhost:9200"]
  index: "%{[fields.log_type]}-%{[agent.version]}-%{}"

  - add_host_metadata: ~
  - add_cloud_metadata: ~

In the filebeat output log i noticed that it says "Set to '{filebeat-7.0.0 {now/d}-000001}' as ILM is enabled." This is default one. why???
Do I have to create a new customized templates to change the index?


(Shaunak Kashyap) #2

Unfortunately its not possible right now to change the index name with ILM enabled. If you want to change the index name, you'll want to disable ILM. You can do this by setting setup.ilm.enabled: false in your filebeat.yml.

I've created an issue on GitHub to document this limitation in Beats documentation:

(George) #4

ok, after set this, everything works
setup.ilm.enabled: false

How can i use ILM in this case? Is there an example?

(system) closed #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.