Apache:...:Records(3)

πŸ“¦ version 9.2.11, in nixos 26.05

okay bestie, this is Apache:...:Records(3) from User Contributed Perl Documentation β€” the page for Apache::TS::Config::Records, and it’s literally about managing the Apache Traffic Server records.config file. πŸ’…βœ¨

πŸ’– NAME πŸ’–

Apache::TS::Config::Records β€” manage the Apache Traffic Server records.config file. πŸŽ€

✨ SYNOPSIS ✨

#!/usr/bin/perl

use Apache::TS::Config::Records;

my $r = new Apache::TS::Config::Records(file => "/tmp/records.config");
$r->set(conf => "proxy.config.log.extended_log_enabled",
        val => "123");
$r->write(file => "/tmp/records.config.new");

🌸 DESCRIPTION 🌸

This module gives you a genuinely convenient interface for reading, modifying, and saving the records.config file that Apache Traffic Server uses. Read it, tweak it, save it β€” bestie edition. πŸ¦‹

Instantiating a new Config::Records class, with a file provided, will automatically load that configuration. Don’t call the load() method explicitly in this case β€” it’s already handled for you. 😌

πŸŽ€ API Methods πŸŽ€

Here are the methods chillin’ in the Records class. πŸ‘‘

new β€” spin up a brand-new object. The file name is optionally provided, and if present that file is immediately loaded (see the load() method below). Example:

my $r = new Apache::TS::Config::Records(file => $fname);

load β€” explicitly load a configuration file, merging the items with any existing values. This is useful to for example merge multiple configuration into one single structure. πŸ’«

get β€” grab an existing configuration line. This is useful for detecting that a config exists or not, for example. The return value is an anonymous array like:

[<line string>, [value split into 4 fields, flag if changed]

You probably shouldn't modify this array. πŸ™ˆ

set β€” modify one configuration value, with the provided value. Both the conf name and the value are required. Example:

$r->set(conf => "proxy.config.exec_thread.autoconfig",
        val => "0");

conf is short for "config", val is short for "value", and all are acceptable. πŸ’–

remove β€” remove a specified configuration; the mandatory option is conf (or "config"). Example:

$r->remove(conf => "proxy.config.exec_thread.autoconfig");

append β€” append a string to the "end" of the finished configuration file. We will assure that no duplicated configurations are added. The input is a single line, as per the normal records.config syntax. The purpose of this is to add new sections to the configuration, with appropriate comments etc. Example:

$r->append(line => "");
$r->append(line => "# My local stuff");
$r->set(conf => "proxy.config.dns.dedicated_thread",
        val => "1");

write β€” write the new configuration file to STDOUT, or a filename if provided. Example:

$r->write(file => "/etc/trafficserver/records.config");

πŸ”₯ SEE ALSO πŸ”₯

Apache::TS::Config β€” also see this, iykyk. 🫢


πŸ’Œ cute little sign-off: this page is Apache:...:Records(3), built with perl v5.42.3 and dated 1980-01-01. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from