# Best way to send complex logs from NodeJS

**URL:** <https://discuss.elastic.co/t/best-way-to-send-complex-logs-from-nodejs/74670>\
**Category:** Logstash\
**Created:** [February 10, 2017, 2:35pm UTC](https://discuss.elastic.co/t/best-way-to-send-complex-logs-from-nodejs/74670 "2017-02-10T14:35:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Bruneaud](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@Simon\_Bruneaud](https://discuss.elastic.co/u/Simon_Bruneaud)\
**Post date:** [February 10, 2017, 2:35pm UTC](https://discuss.elastic.co/t/best-way-to-send-complex-logs-from-nodejs/74670/1 "2017-02-10T14:35:28Z")

</div>

Hey,

I have a NodeJS application, and I would like to send logs to our ELK server (in a docker-container).  
I read a lot about Logstash pipeline, and a lot of articles about how to send logs.  
But I can't figure out what is the best way to send complex data logs to Kibana.

I would like to send server request logs. The logs should contain the following data field:

> - IP adress
> - Geolocalization
> - Country
> - request\_method
> - request\_path
> - request\_duration
> - response\_status
> - response\_message
> - server\_error
> - log\_level
> - log\_message

This logs enable me to extract metrics from it and notify in case of errors.  
**What is the best way to send this data in order to handle this in Kibana?**  
I could use the add\_field property from the **HTTP** input and add every field.

Here is my plugins configuration ( **but I don't know if it works to parse in Kibana** ) :

```
input {
  http {
    port => "8080"
    codec => "json"
  }
}

filter {
  json {
    source => "message"
  }
}

output {
  elasticsearch {
    host => "localhost"
    document_type => "logs"
    codec => "json"
    index => "logstash-%{+YYYY.MM.dd}"
  }
}

```

Note: maybe the best way is not to use Logstash?  
Best regards

---

<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:** [March 10, 2017, 2:35pm UTC](https://discuss.elastic.co/t/best-way-to-send-complex-logs-from-nodejs/74670/2 "2017-03-10T14:35:42Z")

</div>

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