# Logstash output to file and s3 is different

**URL:** https://discuss.elastic.co/t/logstash-output-to-file-and-s3-is-different/200272
**Category:** Logstash
**Created:** [September 19, 2019, 4:49pm UTC](https://discuss.elastic.co/t/logstash-output-to-file-and-s3-is-different/200272 "2019-09-19T16:49:09Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![shazbot](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@shazbot](https://discuss.elastic.co/u/shazbot)
#### Post date: [September 19, 2019, 4:49pm UTC](https://discuss.elastic.co/t/logstash-output-to-file-and-s3-is-different/200272/1 "2019-09-19T16:49:09Z")

</div>

I'm trying to build something that would put logs into s3.

In this case i'm working with netflow and my first step was to just get something out there.

```
input {
  udp {
    port => 9995
    codec => netflow
  }
}

output {
   s3{
     access_key_id => "REMOVED"
     secret_access_key => "REMOVED"
     bucket => "REMOVED"
   }
   file {
     path => "/var/log/logstash/test.log"
 }
}

```

The file output is showing the flows decoded. however the s3 output shows a timestamp, an origin IP and %message, it's allso chunking them up into 5MB files.

Any direction would be appreciated.

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [September 19, 2019, 4:53pm UTC](https://discuss.elastic.co/t/logstash-output-to-file-and-s3-is-different/200272/2 "2019-09-19T16:53:22Z")

</div>

The default codec for a file output is json\_lines. The default codec for an s3 output is line. You should set the codec on the s3 output.

---

<div class="post-metadata">

### Author: ![shazbot](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@shazbot](https://discuss.elastic.co/u/shazbot)
#### Post date: [September 19, 2019, 5:12pm UTC](https://discuss.elastic.co/t/logstash-output-to-file-and-s3-is-different/200272/3 "2019-09-19T17:12:49Z")

</div>

Hi,  
Thank you for the reply. This got me a little further down the road. I really appreciate it.

Just for anyone else who is interested. The output that worked is

```
output {
   s3{
     access_key_id => "Removed"
     secret_access_key => "Removed"
     bucket => "Removed"
     codec => "json_lines"
```

---

<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: [October 17, 2019, 5:12pm UTC](https://discuss.elastic.co/t/logstash-output-to-file-and-s3-is-different/200272/4 "2019-10-17T17:12:56Z")

</div>

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