Hi,

This tests whether the field is an empty string:
 $FileName == ''
On the other hand you should use the following:
 if defined $FileName

An undefined field does not equal to a field containing an empty string.

Regards,
Botond

On Fri, 3 Jan 2014 18:32:21 -0200
Ricardo Brandão <rbrandao...@gmail.com> wrote:

> Hi Botond,
> 
> Exactly, the problem is that I wasn't using binary on the sender side.
> 
> But I'm confused to handle the error.
> 
> I tried to use the configuration below, but it continue with the same
> problem, creating error on nxlog.log
> 
> Could you help me to write a error handling?
> 
> <Output
>  fileOut>
>     Module
>       om_file
> 
>     Exec        if $FileName == '' \
>                 { \
>                     drop(); \
>                     log_info("Error $FileName: type " + type($FileName)); \
>                 } \
>                 else \
>                 { \
>                     log_info("Source Address:" + $MessageSourceAddress +
> ", OutFile - FileName: " + $FileName); \
>                 }
>      File        "/var/log/nxlog/inbox/" +  $MessageSourceAddress   +  "/" +
> file_basename($FileName)
>     CreateDir   TRUE
> </Output>
> 
> 
> On Thu, Jan 2, 2014 at 7:42 PM, Botond Botyanszki <b...@nxlog.org> wrote:
> 
> > Hello,
> >
> > The problem seems to be caused by the $FileName field. There is no
> > explicit parsing for fields, so I guess this is undef, which is of type
> > 'unknown'.
> > I guess you need to configure both sides to send and parse fields. You
> > could use json or nxlog's binary format if you need all.
> >
> > If a field can potentially hold different types, you can check it with
> > the type() function , e.g.:
> >  if type($MyField) == 'string' ...
> >
> > Regards,
> > Botond
> >
> > On Thu, 2 Jan 2014 18:23:28 -0200
> > Ricardo Brandão <rbrandao...@gmail.com> wrote:
> >
> > > Hi ALL,
> > >
> > > I'm using nxlog without problems until now.
> > >
> > > Attached you can find my nxlog.conf (receiver side) and a piece of log
> > file.
> > >
> > > I didn't find the source of error. But it's probably anything with my
> > > nxlog.conf (sender side).
> > >
> > > Any way, this was producing a huge nxlog.log file (in 1 day it was almost
> > > 3GB).
> > >
> > > But what I need to know is: how to handle this kind of error and avoid
> > > produce the big log file.
> > >
> > > --
> > > Ricardo Brandão
> > > http://www.programonauta.com.br
> >
> >
> > ------------------------------------------------------------------------------
> > Rapidly troubleshoot problems before they affect your business. Most IT
> > organizations don't have a clear picture of how application performance
> > affects their revenue. With AppDynamics, you get 100% visibility into your
> > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> > Pro!
> > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> > _______________________________________________
> > nxlog-ce-users mailing list
> > nxlog-ce-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/nxlog-ce-users
> >
> 
> 
> 
> -- 
> Ricardo Brandão
> http://www.programonauta.com.br
> 
> ........__@
> ....._  \ >_
> ....(_) /  (_)

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
nxlog-ce-users mailing list
nxlog-ce-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nxlog-ce-users

Reply via email to