Hi,

Simple question, but there seems to be a lack of detailed examples for 
using the otherwise very useful Search::Elasticsearch CPAN module !

I'm getting syslog data into elasticsearch via fluentd.

What I'd like to do now is run a perl search that will give me results for 
notice, emerg and crit events.  As a test (seeing as I don't get many 
emerg/crit events !), I've tried the  below, but it only seems to pick up 
notice events and doesn't return any info events !

Help welcome !

Thanks.

Tim

#!/usr/bin/perl

use 5.014;
use strict;
use warnings;
use autodie;

use Data::Dumper;
use Search::Elasticsearch;

my $e = Search::Elasticsearch->new();

my $results = $e->search(
   index => 'logstash-2014.08.13',
   body  => {
   query => {
                "bool" => {
                        "must" => {match => { severity => 'notice'},match => 
{ severity => 'info'}}
                }
            }
   }
);

print Dumper($results);        

             

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/42e60034-655f-46ca-979e-308b0e7532e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to