1WWW::Splunk(3) User Contributed Perl Documentation WWW::Splunk(3)
2
3
4
6 WWW::Splunk - Client library for Splunk log search engine
7
9 use WWW::Splunk;
10
11 my $splunk = WWW::Splunk->new({
12 host => $host,
13 port => $port,
14 login => $login,
15 password => $password,
16 unsafe_ssl => 1,
17 verbose => 0,
18 });
19
20 my $sid = $splunk->start_search('selinux avc');
21 $splunk->poll_search($sid);
22 until ($splunk->results_read($sid)) {
23 print scalar $splunk->search_results($sid);
24 }
25 print " results found\n";
26
28 This module contains utility functions for Splunk API, implementing
29 version 4.1 API, verified to work with 4.2, 4.3 and 5.0.3 versions.
30
31 start_search (string) [(since)] [(until)]
32 Initiate a search, return a SID (Search ID) string.
33
34 rt_search (string) (callback) [(since)] [(until)]
35 Initiate a real-time search, calling a callback for each line matched.
36
37 Finishes only if connection terminates (potentially never), returning
38 number of results consumed.
39
40 search_done (sid)
41 Return true if the search is finished.
42
43 poll_search (sid)
44 Wait for a search to finish.
45
46 search_results (sid)
47 Return an array of the matched events. If called multiple times, it
48 only returns events which were added from the time of the last call.
49 Oh, and you can't run multiple search concurrently with single
50 WWW::Splunk instance. Otherwise, WWW::Splunk is perfectly thread-safe.
51
52 results_read (sid)
53 Return true if search is finished and all there are no more results to
54 read (everything was fetched with search_results).
55
57 Lubomir Rintel, <lkundrak@v3.sk>, Michal Josef XpaXek <skim@cpan.org>
58
59 The code is hosted on GitHub
60 <http://github.com/tupinek/perl-WWW-Splunk>. Bug fixes and feature
61 enhancements are always welcome.
62
64 This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
65
66
67
68perl v5.32.0 2020-07-28 WWW::Splunk(3)