Hi, UUID generation and some other utility functions have been on the TODO list for quite some time and these will be implemented sooner or later.
I have looked at this issue with the xm_perl module quickly. You should use multiple xm_perl instances like you did because the callback is invoked from different threads running the input modules. Unfortunately it seems to hang/crash because there is some race condition when the perl interpreter is accessed. This needs to be fixed. Regards, Botond On Thu, 16 Jan 2014 08:17:08 -0500 Dillon Detour <dillondet...@gmail.com> wrote: > Has anyone created UUID's in NXLOG? I would like to create an unique > identifier for each event so I can find identical events across hdfs and > elasticsearch. > > I tried the following but it only gets me part of the way there: > <Extension perl1> > Module xm_perl > PerlCode /opt/uuid/uuid.pl > </Extension> > <Input in_udp_syslog> > Module im_udp > Host 0.0.0.0 > Port 514 > Exec perl->call("getuuid"); > Exec parse_syslog(); to_json(); > </Input> > ------------------------------- > /opt/uuid/uuid.pl: > > use warnings; > use Data::GUID; > > # Without Log::Nxlog you cannot access (read or modify) the event data > # so don't forget this: > use Log::Nxlog; > > sub getuuid > { > # The event data is passed here when this method is invoked by the module > my ( $event ) = @_; > my $guid = Data::GUID->new; > Log::Nxlog::set_field_string($event, 'uuid', $guid->as_string); > > } > > EOF > --------------------------- > The above works great until I add it to a second input and nxlog hangs: > <Input in_udp_syslog2> > Module im_udp > Host 0.0.0.0 > Port 515 > Exec perl->call("getuuid"); > Exec parse_syslog(); to_json(); > </Input> > > I tried adding a second extension pointing at the same perl code and still > no luck > <Extension perl2> > Module xm_perl > PerlCode /opt/uuid/uuid.pl > </Extension> > > I am open to other ways to solve the problem of UUIDs but would still like > to know how I could run a common perl script across multiple inputs. > > Any help is appreciated! ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ nxlog-ce-users mailing list nxlog-ce-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nxlog-ce-users