# Problem with ansible-beats and processors config

**URL:** https://discuss.elastic.co/t/problem-with-ansible-beats-and-processors-config/213690
**Category:** Beats
**Tags:** filebeat
**Created:** [January 3, 2020, 11:04am UTC](https://discuss.elastic.co/t/problem-with-ansible-beats-and-processors-config/213690 "2020-01-03T11:04:00Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![blabu23](https://avatars.discourse-cdn.com/v4/letter/b/f07891/32.png) [@blabu23](https://discuss.elastic.co/u/blabu23)
#### Post date: [January 3, 2020, 11:04am UTC](https://discuss.elastic.co/t/problem-with-ansible-beats-and-processors-config/213690/1 "2020-01-03T11:04:00Z")

</div>

Hi there! I am trying to install/configure filebeat with the ansible role from elastic.  
My playbook looks like this:

```
- hosts: filebeat_hosts
  roles:
    - role: role-beats
  vars:
    use_repository: true
    beats_version: 6.8.5
    beat: filebeat
    beat_conf:
      inputs:
        - type: log
          enabled: false
          paths:
        - type: docker
          enabled: true
          containers.ids: '*'

      filebeat.config.modules:
        path: ${path.config}/modules.d/*.yml
        reload.enabled: false

      setup.template.settings:
        index.number_of_shards: 3

      processors:
        - add_locale: ~
        - add_host_metadata: ~
        - add_cloud_metadata: ~
        - add_docker_metadata: ~

After running ansible-playbook with this the result on my host is fine with the exception of the processors section. It results in:

processors:
- add_locale: null
- add_host_metadata: null
- add_cloud_metadata: null
- add_docker_metadata: null

```

This is AFAIK normal since ansible/jinja2 is treating the ~ as an alias for null.  
Escaping the ~ with single or double quotes results in this:

```
processors:
- add_locale: '~'
- add_host_metadata: '~'
- add_cloud_metadata: '~'
- add_docker_metadata: '~'

```

but filebeat then complaints with this message when trying to start and finally stops starting:

Exiting: error unpacking config data: required 'object', but found 'string' in field 'processors.0.add\_locale' (source:'/etc/filebeat/filebeat.yml')

Any idea, how to configure this section with ansible?

Cheers, Martin

---

<div class="post-metadata">

### Author: ![Alex\_Kristiansen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_kristiansen/32/46086_2.png) [@Alex\_Kristiansen](https://discuss.elastic.co/u/Alex_Kristiansen)
#### Post date: [January 3, 2020, 4:57pm UTC](https://discuss.elastic.co/t/problem-with-ansible-beats-and-processors-config/213690/2 "2020-01-03T16:57:32Z")

</div>

If I had to take a guess, I would say the escaping isn't working properly. You should get a config object like this:

```auto
processors:
- add_locale: ~

```

Note the lack of single quotes.

---

<div class="post-metadata">

### Author: ![blabu23](https://avatars.discourse-cdn.com/v4/letter/b/f07891/32.png) [@blabu23](https://discuss.elastic.co/u/blabu23)
#### Post date: [January 3, 2020, 5:03pm UTC](https://discuss.elastic.co/t/problem-with-ansible-beats-and-processors-config/213690/3 "2020-01-03T17:03:05Z")

</div>

Exactly my opinion... but I was and am not able to make this work and produce the correct values in the config...

BTW: the template used (the original from elastic) uses the content of the content hash in this way:

{{ beat\_conf | to\_nice\_yaml(indent=2) }}

---

<div class="post-metadata">

### Author: ![blabu23](https://avatars.discourse-cdn.com/v4/letter/b/f07891/32.png) [@blabu23](https://discuss.elastic.co/u/blabu23)
#### Post date: [January 3, 2020, 5:05pm UTC](https://discuss.elastic.co/t/problem-with-ansible-beats-and-processors-config/213690/4 "2020-01-03T17:05:59Z")

</div>

Sorry, I edited my inital message. The formatting was garbled. Now it is like in my ansible playbook...

---

<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: [January 31, 2020, 5:06pm UTC](https://discuss.elastic.co/t/problem-with-ansible-beats-and-processors-config/213690/5 "2020-01-31T17:06:01Z")

</div>

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