WWW::Splunk(3pm)
πΈ NAME πΈ
okay so bestie, meet WWW::Splunk β a client library for the Splunk log search engine. yes, the big log-search one. this is her manual page, WWW::Splunk(3pm), filed under User Contributed Perl Documentation, and she's here to make your Splunk API life cute and functional π
β¨ SYNOPSIS β¨
the whole vibe in one little code block, no notes:
use WWW::Splunk;
my $splunk = WWW::Splunk->new({
host => $host,
port => $port,
login => $login,
password => $password,
unsafe_ssl => 1,
verbose => 0,
});
my $sid = $splunk->start_search('selinux avc');
$splunk->poll_search($sid);
until ($splunk->results_read($sid)) {
print scalar $splunk->search_results($sid);
}
print " results found\n";
likeβ¦ build the object, kick off a search, wait for it, dump results until there's nothing left, print the count. that's it. that's the whole main character arc. π¦
π DESCRIPTION π
this module is a little bundle of utility functions for the Splunk API. she implements the version 4.1 API, and she's been verified to work with the 4.2, 4.3 and 5.0.3 versions too. so she's giving range, she's giving longevity, she's giving iykyk. π
π start_search (string) [(since)] [(until)]
kick off a search and get back a SID (that's a Search ID) string. it's giving "go bestie go". π
π₯ rt_search (string) (callback) [(since)] [(until)]
start a real-time search, and she'll call your callback for every single line matched. every one. no cap.
heads up though β this one only finishes if the connection terminates, which meansβ¦ potentially never π and when it does wrap up, it returns the number of results consumed.
β
search_done (sid)
returns true if the search is finished. simple. iconic. periodt.
β³ poll_search (sid)
just sits there and waits for a search to finish. the patient bestie of the group chat. π«Ά
π¦ search_results (sid)
returns an array of the matched events. here's the tea though β if you call it multiple times, it only gives you the events that were added from the time of the last call. so don't be shocked when it's not the whole thing every time, she's incremental like that. π
oh, and also: you can't run multiple searches concurrently with a singleWWW::Splunkinstance. otherwise,WWW::Splunkis perfectly thread-safe. noted, bestie. π
π results_read (sid)
returns true if the search is finished <em>and</em> there are no more results to read β meaning everything got fetched already with search_results. the "we're so done here" check. π
π AUTHORS π
the legends behind this:
- Lubomir Rintel,
<lkundrak@v3.sk> - Michal Josef Ε paΔek
<skim@cpan.org>
the code is hosted on GitHub at http://github.com/michal-josef-spacek/perl-WWW-Splunk. bug fixes and feature enhancements are always welcome β so if you're feeling generous with your brain, slide in. π
π LICENSE π
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, legally. β
πΈ DONATIONS πΈ
if you use this library and find it useful, donations are greatly appreciated! support the devs, they ate. π
and that's the whole page, bestie β this was WWW::Splunk(3pm), generated with perl v5.42.0 on 2025-07-25. go forth and search your logs. no cap, fr fr. πβ¨
π¦ where this page comes from
- fedora 43: perl-WWW-Splunk 2.09-7.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms