Advertisement
robn

Untitled

Sep 12th, 2013
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.62 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use 5.010;
  4. use warnings;
  5. use strict;
  6.  
  7. use Moo;
  8. use MooX::Options;
  9. use Message::Passing::DSL;
  10.  
  11. with 'Message::Passing::Role::Script';
  12.  
  13. sub build_chain {
  14.   my ($self) = @_;
  15.   message_chain {
  16.     output elasticsearch => (
  17.       class => "ElasticSearch",
  18.       elasticsearch_servers => [qw(log1.nyi.mail.srv.osa:9200)],
  19.     );
  20.     decoder decode_json => (
  21.       class => "JSON",
  22.       output_to => "elasticsearch",
  23.     );
  24.     input zeromq => (
  25.       class => "ZeroMQ",
  26.       output_to => "decode_json",
  27.       socket_bind => "tcp://*:9400",
  28.       linger => 1,
  29.     );
  30.   };
  31. }
  32.  
  33. __PACKAGE__->start;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement