# Multiple Beat Imports different codec

**URL:** <https://discuss.elastic.co/t/multiple-beat-imports-different-codec/61219>\
**Category:** Logstash\
**Created:** [September 22, 2016, 8:52am UTC](https://discuss.elastic.co/t/multiple-beat-imports-different-codec/61219 "2016-09-22T08:52:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ado](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@ado](https://discuss.elastic.co/u/ado)\
**Post date:** [September 22, 2016, 8:52am UTC](https://discuss.elastic.co/t/multiple-beat-imports-different-codec/61219/1 "2016-09-22T08:52:37Z")

</div>

Hi,

I do use on client side top, packet and filebeat.  
The filebeat service ready log file which is json formatted per line.  
filebeat.yml

```
filebeat:
    prospectors:
        -
            paths:
                - /srv/ucweb/logs/main*.txt
            input_type: log
output:
    logstash:
        hosts: ["xxxxxx"]
        index: filebeat

```

On server side all beat services first send their data to a logstash with beat import  
logstash.config on server:

```
input {
    beats {
        port => 5044
        # codec => "json_lines"
        type => "packetbeat"
    }
}

output {
    elasticsearch {
        hosts => "127.0.0.1:9200"
        manage_template => false
        index => "%{[@metadata][beat]}"
        document_type => "%{[@metadata][type]}"
    }
}

```

My problem is that the JSON content from the logs are just a string in the elasticsearch db. Under the "message" tag. If I comment in codec =\> "json\_lines" no data from filebeat is imported to elasticsearch.

Thank you very much

---

<div class="post-metadata">

**Author:** ![ado](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@ado](https://discuss.elastic.co/u/ado)\
**Post date:** [September 22, 2016, 9:25am UTC](https://discuss.elastic.co/t/multiple-beat-imports-different-codec/61219/2 "2016-09-22T09:25:42Z")

</div>

The trick was just to use

```
codec => "json"

```

instead of

```
codec => "json_lines"

```

Itrs strange because the logfiles i used where JSON line determinated linke  
{"a": "b"}\n  
{"a": "c"}....

---

<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:** [July 6, 2017, 4:37am UTC](https://discuss.elastic.co/t/multiple-beat-imports-different-codec/61219/3 "2017-07-06T04:37:24Z")

</div>


