OCTO_EX...R_FIELDS(1)
π octo_extractor_fields β the tea β
okay bestie, so this is a page from the User Contributed Perl Documentation for OCTO_EX...R_FIELDS(1), and it's lowkey iconic because it's literally the manual for the program the Octopussy Project uses to pull logs out of stuff β but, like, by table fields specifically. β¨
πΈ NAME πΈ
octo_extractor_fields β the Octopussy Logs Extractor (by table fields) program. that's her. that's the whole name. π«Ά
π SYNOPSIS π
octo_extractor --device <device> --service <service>
--table <table> --loglevel <loglevel> --taxonomy <taxonomy>
--begin YYYYMMDDHHMM --end YYYYMMDDHHMM
--fields <field1,field2,fieldn> [ --pid_param <string> ] [ --json <json_outputfile> ]
like yes, that's a lot of flags, but you got this bestie. π
π¦ DESCRIPTION π¦
octo_extractor_fields is the program used by the Octopussy Project to extract Logs (by table fields). it does exactly what it says on the tin and it does it well. no cap. π₯
β¨ FUNCTIONS β¨
π String_List($type, $any, $fct, @args)
Returns a List of elements separated by ", " from one function and args. cute little joiner behavior. π
π Help()
Prints Help. that's it. she helps. π
π Progress($msg, $num, $nb_match)
Sets progress status. so you can watch it cook. π
π Get_Messages_To_Parse($services, $loglevel, $taxonomy, $table, $fields)
Returns list of Messages to parse. giving "let me find the ones I actually care about" energy. π
π Get_TimePeriod_Files($devices, $services, $begin, $end)
Returns list of Files for Devices $devices, Services $services and Period $begin-$end. time-bounded, as she should be. β³β¨
π Print_Logs($devices, $services, $loglevel, $taxo, $begin, $end, $re_incl, $re_excl)
Prints Logs. the main character moment of the whole page tbh. π
π the correlation bit (unnamed, but ICONIC)
this one has no cute little function name, it's just vibes and code, so here it is, verbatim, exactly as written, do not touch:
my $correlation_key = 'id';
my @correlation_values = ('idpes', 'idcnx', 'cpcnx');
my %correl = ();
# Init correlation table
foreach my $d (@logs) {
foreach my $cv (@correlation_values) {
if (NOT_NULL($d->{$cv}) && ($d->{$cv} ne "N/A") && ($d->{$cv} ne "0")) {
$correl{$d->{$correlation_key}}{$cv} = $d->{$cv};
}
}
}
# Use correlation table to fill NULL values
foreach my $d (@logs) {
foreach my $cv (@correlation_values) {
if (NULL($d->{$cv}) || ($d->{$cv} eq 'N/A') || ($d->{$cv} eq '0')) {
$d->{$cv} = $correl{$d->{$correlation_key}}{$cv};
}
}
}
basically: build a lookup table from the non-null, non-"N/A", non-"0" values, then go back and fill in the null / 'N/A' / '0' ones from it. it's giving glow-up for your data. π
π End()
Ends Extraction. bye bestie, extraction over. πβ¨
π AUTHOR π
Sebastien Thebert <octo.devel@gmail.com> β the legend behind all of this. π
π SEE ALSO π
octo_dispatcherocto_extractorocto_parserocto_uparserocto_reporterocto_scheduler
the whole squad fr fr. go read them too, iykyk. π«Ά
π and that's the whole page bestie, no notes. this version was documented withperl v5.22.2and dated2016-05-04β yeah she's a little vintage, but vintage is just iconic with extra steps. stay slaying, and remember: extract responsibly. π πβ¨
π¦ where this page comes from
- ubuntu jammy: octopussy 1.0.6-0ubuntu2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms