Hi, I'm trying to send my custom jsotn to GrayLog.

My json file is:

    "Faxes":  "68",
    "Last30DaysEmails":  "9728",
    "TodayEmails":  "66"

This is my nxlog config file:

define ROOT C:\Program Files (x86)\nxlog

Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
SpoolDir %ROOT%\data
LogFile %ROOT%\data\nxlog.log

<Extension gelf>
    Module xm_gelf

<Extension multiline>
    Module    xm_multiline
        HeaderLine    /\d{4}-\d{2}-\d{2}\s\d*:\d\d:\d*,\d{3}\s[a-zA-Z]*\s\s\S\s\[Begin Lead\]/
        EndLine        /\d{4}-\d{2}-\d{2}\s\d*:\d\d:\d*,\d{3}\s[a-zA-Z]*\s\s\S\s\[End Lead\]/

<Extension json>
    Module    xm_json

<Input im_file>
    Module   im_file
    File "C:\\logs\\myfile.json"
    InputType multiline
    SavePos FALSE
   ReadFromLast FALSE

<Output om_udp>
    Module      om_udp
    Port        3514
    OutputType  GELF

<Route 1>
    Path im_file => om_udp

Now my problems is: When I send the file to GrayLog server I see multi line with different messages (as json variable), and not all in a single message.

How can do to configure correctly my system? Thanks for the support.


AskedJune 29, 2020 - 10:49am

Answers (0)