On 12/22/2013 5:43 AM, Rick Hofstede wrote:
> I'm looking for a simple way to select all sources in a given profile for a 
> certain
> query. So instead of specifying the sources manually as in [1], I'm looking 
> for
> something that works like [2].
>
> [1] nfdump -M /data/nfsen/profiles-data/SSH/source1:source2/ -r 
> nfcapd.201312151000
>
> [2] nfdump -M /data/nfsen/profiles-data/SSH/*/ -r nfcapd.201312151000
>
> So without knowing all sources for a profile beforehand, I want to select all 
> of them.
> Does someone of you know how to do this?
>

I have a Perl script that runs similar queries, but I had to enumerate the 
sources from
the hash keys:

# load NfSen configuration information into distinct namespace
my $basedir = "/usr/local/nfsen";
{
    package NfSen;
    do "$basedir/etc/nfsen.conf"
        or die "$main::Script: $basedir/etc/nfsen.conf: $!\n";
}

### skip some stuff, then:

@sources = ("ALL") unless @sources;
@sources = map { $_ eq "ALL" ? keys(%NfSen::sources) : split(/\s*,\s*/,$_) } 
@sources;

There is a Perl module for NfDump (Net::NfDump) that was recently discussed, 
and it
probably simplifies the task further.

Regards,
Mark

-- 
Mark D. Nagel, CCIE #3177 <mna...@willingminds.com>
Principal Consultant, Willing Minds LLC (http://www.willingminds.com)
cell: 949-279-5817, desk: 714-495-4001, fax: 714-646-8277

** For faster support response time, please
** email supp...@willingminds.com or call 714-495-4000

------------------------------------------------------------------------------
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
_______________________________________________
Nfdump-discuss mailing list
Nfdump-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfdump-discuss

Reply via email to