# Send file logs to logstash

**URL:** <https://discuss.elastic.co/t/send-file-logs-to-logstash/115135>\
**Category:** Logstash\
**Created:** [January 11, 2018, 4:27pm UTC](https://discuss.elastic.co/t/send-file-logs-to-logstash/115135 "2018-01-11T16:27:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dinaWork](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@dinaWork](https://discuss.elastic.co/u/dinaWork)\
**Post date:** [January 11, 2018, 4:27pm UTC](https://discuss.elastic.co/t/send-file-logs-to-logstash/115135/1 "2018-01-11T16:27:48Z")

</div>

I have files in GCS, each file contains json lines  
file example:

```auto
{"msg": "hello world", "level": "info", "timestamp": "2017-09-01T00:00"}
{"msg": "some error", "level": "error", "timestamp": "2017-09-02T00:00"}
{"msg": "success" , "level": "info",, "timestamp": "2017-09-03T00:00"}
...

```

I am running on all files in GCS, downloading each file and Im trying to send them to logstash - so I get each line of log in elastic

here is my logstash conf:

```auto
input {
  tcp {
    port => 5000
  }
}
output {
  elasticsearch {
    hosts => "https://xxxxxxxxxxx.us-central1.gcp.cloud.es.io:9243"
    user => "elastic"
    password => "xxxxxxx"
    index => "app-log-%{+YYYY.MM.dd}"
  }
}

```

now how do I send the file contents to logstash?  
should I use a different input than tcp? maybe filebeat?  
is there any demo code in nodejs (or other language) to send the files?

---

<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:** [February 8, 2018, 4:27pm UTC](https://discuss.elastic.co/t/send-file-logs-to-logstash/115135/2 "2018-02-08T16:27:50Z")

</div>

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