send custom json file to GrayLog


#1 m.ferrara

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>

<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>

<Extension json>
    Module    xm_json
</Extension>

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

<Output om_udp>
    Module      om_udp
    Host        192.168.1.100
    Port        3514
    OutputType  GELF
</Output>

<Route 1>
    Path im_file => om_udp
</Route>

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.

Marco