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

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 {
mode => "server"
port => 9563
codec => json
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) => {
    var conn = net.createConnection({ host: addrhost, port: addrport }, () => {
            console.log(`connected to ${addrhost} in ${addrport}`);
            console.log(`sending ${this.message}`);

        .on('error', (err) => {

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?

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