# Logstash doesn't seem to recive file via TCP from nodejs

**URL:** <https://discuss.elastic.co/t/logstash-doesnt-seem-to-recive-file-via-tcp-from-nodejs/115532>\
**Category:** Logstash\
**Created:** [January 15, 2018, 11:32am UTC](https://discuss.elastic.co/t/logstash-doesnt-seem-to-recive-file-via-tcp-from-nodejs/115532 "2018-01-15T11:32:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yishain11](https://avatars.discourse-cdn.com/v4/letter/y/df705f/32.png) [@yishain11](https://discuss.elastic.co/u/yishain11)\
**Post date:** [January 15, 2018, 11:32am UTC](https://discuss.elastic.co/t/logstash-doesnt-seem-to-recive-file-via-tcp-from-nodejs/115532/1 "2018-01-15T11:32:35Z")

</div>

Hi everyone!  
I try to sent some files from node js app to logstash input tcp.  
What the node file do? it fetches a minified json, and try to send it.  
Even though the connections seems to be establishited and no errors occur, logstash dosn't output anything.

This is logstash conf file:

> input {  
> tcp{  
> mode =\> "server"  
> port =\> 9563  
> codec =\> json  
> }  
> }  
> filter{}  
> output {  
> stdout{codec =\> rubydebug}  
> }

This is the node file:

```
const net = require('net')
fs = require('fs')
childPro = require('child_process')
addrhost = "some_ip"
addrport = 9563
var message

console.log(`starting client.js`);

var sendDataPromise = new Promise((resolve, reject) => {
    fs.readFile('./results', "utf8", (err, data) => {
        if (err) throw err;
        console.log("no errors found");
        this.message = data
        resolve('file read and saved localy')
    })

});
sendDataPromise.then((succMsg) => {
    console.log(succMsg);
    var conn = net.createConnection({ host: addrhost, port: addrport }, () => {
            console.log(`connected to ${addrhost} in ${addrport}`);
            console.log(`sending ${this.message}`);
            conn.write(JSON.stringify(this.message))
            process.exit(2)

        })
        .on('error', (err) => {
            console.error(err);
            process.exit(1)
        })
})

```

and finally, this is the logstash output:

```
[root@qa8 bin]# ./logstash -f /etc/logstash/conf.d/try_config.conf
WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
Could not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the console

```

and it stays like this.  
My system is CentOS 7, and the file size is in the single digit kbs.

Why dosn't logstash show anything?  
Thanks!

---

<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 12, 2018, 11:32am UTC](https://discuss.elastic.co/t/logstash-doesnt-seem-to-recive-file-via-tcp-from-nodejs/115532/2 "2018-02-12T11:32:53Z")

</div>

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