Send json log via logstash to nginx and graylog

i have log with json format, I want send this log by logstash to nginx (my loadbalancer), so i use http plugin for logstash. my nginx config is:

[root@loadbalancer conf.d]# cat graylog.conf
upstream graylog_input {

server {
  listen 12303;
   location / {
     proxy_set_header  Host $http_host;
     proxy_set_header  X-Forwarded-Host $host;
     proxy_set_header  X-Forwarded-Server $host;
     proxy_set_header  X-Real-IP $remote_addr;
     proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_pass        http://graylog_input;

my logstash config is:
input {
tcp {
port => “2234”
codec => json_lines
host => localhost
output {
http {
http_compression => true
codec => “json”
url => “
http_method => “post”

I check three input in graylog (Raw/Plaintext TCP, GELF TCP, GELF HTTP) but all input is not correct.
What input should I use? Where is the wrong thing??

you have a logfile that is json and want to ship that to Graylog?

use filebeat to read the logfile and ingest that into a beats input of Graylog.

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