# How can I change "winlogbeat" name in "template.name"?

**URL:** https://discuss.elastic.co/t/how-can-i-change-winlogbeat-name-in-template-name/98442
**Category:** Beats
**Tags:** winlogbeat
**Created:** [August 26, 2017, 7:17am UTC](https://discuss.elastic.co/t/how-can-i-change-winlogbeat-name-in-template-name/98442 "2017-08-26T07:17:25Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![hack3rcon](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@hack3rcon](https://discuss.elastic.co/u/hack3rcon)
#### Post date: [August 26, 2017, 7:17am UTC](https://discuss.elastic.co/t/how-can-i-change-winlogbeat-name-in-template-name/98442/1 "2017-08-26T07:17:25Z")

</div>

Hello.  
Why I can't change "winlogbeat" name in "[template.name](http://template.name)" section in config file?

Thank you.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [August 26, 2017, 9:59am UTC](https://discuss.elastic.co/t/how-can-i-change-winlogbeat-name-in-template-name/98442/2 "2017-08-26T09:59:30Z")

</div>

You can.  
If you are having issues then please provide more details on what the problem is and what you are doing.

---

<div class="post-metadata">

### Author: ![hack3rcon](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@hack3rcon](https://discuss.elastic.co/u/hack3rcon)
#### Post date: [August 26, 2017, 10:07am UTC](https://discuss.elastic.co/t/how-can-i-change-winlogbeat-name-in-template-name/98442/3 "2017-08-26T10:07:39Z")

</div>

My config is :

```auto
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["172.30.9.20:9200"]
  template.name: "server1"
  template.path: "server1.template.json"
  template.overwrite: false

  # Optional protocol and basic auth credentials.
  #protocol: "https"
  #username: "elastic"
  #password: "changeme"
```

But when I restart "winlogbeat" service then I got:  
 ![service](https://us1.discourse-cdn.com/elastic/original/3X/a/2/a2339e45592db5232f71ffbaeecd4ad342f1044b.png)

Why?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [August 26, 2017, 10:25am UTC](https://discuss.elastic.co/t/how-can-i-change-winlogbeat-name-in-template-name/98442/4 "2017-08-26T10:25:10Z")

</div>

What does the log show?

---

<div class="post-metadata">

### Author: ![hack3rcon](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@hack3rcon](https://discuss.elastic.co/u/hack3rcon)
#### Post date: [August 26, 2017, 12:32pm UTC](https://discuss.elastic.co/t/how-can-i-change-winlogbeat-name-in-template-name/98442/5 "2017-08-26T12:32:18Z")

</div>

Log said:

```auto
The winlogbeat service failed to start due to the following error: 
The service did not respond to the start or control request in a timely fashion.
A timeout was reached (30000 milliseconds) while waiting for the winlogbeat service to connect.
```

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [August 26, 2017, 4:06pm UTC](https://discuss.elastic.co/t/how-can-i-change-winlogbeat-name-in-template-name/98442/6 "2017-08-26T16:06:25Z")

</div>

@hack3rcon Please post your full configuration, Winlogbeat version, and the config test output (see #3 in [this](https://www.elastic.co/guide/en/beats/winlogbeat/current/winlogbeat-configuration.html) section of the getting started guide).

And BTW there should be a log dir and file in the directory where you installed Winlogbeat. It would be good to check that too as @warkolm suggested.

---

<div class="post-metadata">

### Author: ![hack3rcon](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@hack3rcon](https://discuss.elastic.co/u/hack3rcon)
#### Post date: [August 27, 2017, 6:19am UTC](https://discuss.elastic.co/t/how-can-i-change-winlogbeat-name-in-template-name/98442/7 "2017-08-27T06:19:41Z")

</div>

My configuration is:

```auto
###################### Winlogbeat Configuration Example ##########################

# This file is an example configuration file highlighting only the most common
# options. The winlogbeat.full.yml file from the same directory contains all the
# supported options with more comments. You can use it as a reference.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/winlogbeat/index.html

#======================= Winlogbeat specific options ==========================

# event_logs specifies a list of event logs to monitor as well as any
# accompanying options. The YAML data type of event_logs is a list of
# dictionaries.
#
# The supported keys are name (required), tags, fields, fields_under_root,
# forwarded, ignore_older, level, event_id, provider, and include_xml. Please
# visit the documentation for the complete details of each option.
# https://go.es.io/WinlogbeatConfig
winlogbeat.event_logs:
# - name: Application
# ignore_older: 72h
  - name: Security
    event_id: 4660,4663
# - name: System

#================================ General =====================================

# The name of the shipper that publishes the network data. It can be used to group
# all the transactions sent by a single shipper in the web interface.
#name:

# The tags of the shipper are included in their own field with each
# transaction published.
#tags: ["service-X", "web-tier"]

# Optional fields that you can specify to add additional information to the
# output.
#fields:
# env: staging

#================================ Outputs =====================================

# Configure what outputs to use when sending the data collected by the beat.
# Multiple outputs may be used.

#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["172.30.9.20:9200"]
  template.name: "server1"
  template.path: "server1.template.json"
  template.overwrite: false

  # Optional protocol and basic auth credentials.
  #protocol: "https"
  #username: "elastic"
  #password: "changeme"

#----------------------------- Logstash output --------------------------------
#output.logstash:
  # The Logstash hosts
 # hosts: ["172.30.9.20:5044"]
  

  # Optional SSL. By default is off.
  # List of root certificates for HTTPS server verifications
  #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

  # Certificate for SSL client authentication
  #ssl.certificate: "/etc/pki/client/cert.pem"

  # Client Certificate Key
  #ssl.key: "/etc/pki/client/cert.key"

#================================ Logging =====================================

# Sets log level. The default log level is info.
# Available log levels are: critical, error, warning, info, debug
#logging.level: debug

# At debug level, you can selectively enable logging only for some components.
# To enable all selectors use ["*"]. Examples of other selectors are "beat",
# "publish", "service".
#logging.selectors: ["*"]
```

and the output of test is :

 ![ps2](https://us1.discourse-cdn.com/elastic/original/3X/7/1/7132737a772d637666a320cec65f5ad1232ef2ce.png)

What is your idea?

---

<div class="post-metadata">

### Author: ![hack3rcon](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@hack3rcon](https://discuss.elastic.co/u/hack3rcon)
#### Post date: [August 27, 2017, 6:21am UTC](https://discuss.elastic.co/t/how-can-i-change-winlogbeat-name-in-template-name/98442/8 "2017-08-27T06:21:21Z")

</div>

I found and solve the problem. I must create a file with the name "server1.template.json", But why Kibana get it with the name "winlogbeat". How can I change this name?

```auto
curl -XGET 'http://localhost:9200/_cat/indices?v'
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open .kibana b3u7iAFMS0O0ZaVkZ12w6Q 1 1 1 0 3.1kb 3.1kb
yellow open winlogbeat-2017.08.26 4rk35O39TpuUNkP_VpTxDw 5 1 9 0 119.8kb 119.8kb
```

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [August 28, 2017, 1:16pm UTC](https://discuss.elastic.co/t/how-can-i-change-winlogbeat-name-in-template-name/98442/9 "2017-08-28T13:16:27Z")

</div>

Setting `output.elasticsearch.template.name` modifies the name of the template, not the name of index. That value is used when installing the template (e.g. `PUT _template/<template.name>`). See the ES documentation on [index templates](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html) for more details.

The [`output.elasticsearch.index`](https://www.elastic.co/guide/en/beats/winlogbeat/current/elasticsearch-output.html#_index) option controls the destination index name. If you customize the index name then you also need to modify the index template JSON file to make it apply to the new index name. See the "template" value inside the JSON file (it defaults to `winlogbeat-*`).

---

<div class="post-metadata">

### Author: ![hack3rcon](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@hack3rcon](https://discuss.elastic.co/u/hack3rcon)
#### Post date: [August 28, 2017, 3:16pm UTC](https://discuss.elastic.co/t/how-can-i-change-winlogbeat-name-in-template-name/98442/10 "2017-08-28T15:16:38Z")

</div>

Excuse me, I'm confused. I must put `output.elasticsearch.index` into my "winlogbeat" configuration?

```auto
output.elasticsearch:
  hosts: ["http://localhost:9200"]
  index: "logs-%{+yyyy.MM.dd}"
```

then "template JSON" file and change "winlogbeat-_" to "logs-_" ?

Thank you.

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [August 28, 2017, 3:32pm UTC](https://discuss.elastic.co/t/how-can-i-change-winlogbeat-name-in-template-name/98442/11 "2017-08-28T15:32:01Z")

</div>

Yes, that's the correct config.

```auto
output.elasticsearch:
  hosts: ["http://localhost:9200"]
  index: 'logs-%{+yyyy.MM.dd}'

```

And you need to modify the `template` value inside of the [winlogbeat.template.json](https://github.com/elastic/beats/blob/v5.5.2/winlogbeat/winlogbeat.template.json#L178) file. This causes the index template to apply to the custom index name you are using. You'll want to make sure that you overwrite the existing template after making the modification.

---

<div class="post-metadata">

### Author: ![hack3rcon](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@hack3rcon](https://discuss.elastic.co/u/hack3rcon)
#### Post date: [August 29, 2017, 7:48am UTC](https://discuss.elastic.co/t/how-can-i-change-winlogbeat-name-in-template-name/98442/12 "2017-08-29T07:48:15Z")

</div>

Thank you.  
I don't need to rename any file. I just used ` index: "logs-%{+yyyy.MM.dd}"` in config file and it is OK.  
Why I just change `template` value inside of the winlogbeat.template.json file?

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [August 29, 2017, 1:23pm UTC](https://discuss.elastic.co/t/how-can-i-change-winlogbeat-name-in-template-name/98442/13 "2017-08-29T13:23:44Z")

</div>

> [@hack3rcon](#):
>
> Why I just change template value inside of the winlogbeat.template.json file?

The `template` field specifies a pattern that is matched against the names of newly created indices. The settings and mappings will be applied to any index name that matches. Templates are only applied at index creation time. Changing a template will have no impact on existing indices.

---

<div class="post-metadata">

### Author: ![hack3rcon](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@hack3rcon](https://discuss.elastic.co/u/hack3rcon)
#### Post date: [September 1, 2017, 11:15am UTC](https://discuss.elastic.co/t/how-can-i-change-winlogbeat-name-in-template-name/98442/14 "2017-09-01T11:15:45Z")

</div>

Thus:  
1- Use `index: "logs-%{+yyyy.MM.dd}"` in config file.  
2- open "winlogbeat.template.json" file and replace all "winlogbeat-_" with "logs-_".

Must I change `"template.name: "winlogbeat"` in config file too?

OK?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 29, 2017, 11:16am UTC](https://discuss.elastic.co/t/how-can-i-change-winlogbeat-name-in-template-name/98442/15 "2017-09-29T11:16:08Z")

</div>

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