Apache:...:Records(3)

πŸ“¦
version 9.2.16 Β· 2 versions
, in epel 9

πŸ’– NAME πŸ’–

Apache::TS::Config::Records β€” manage the Apache Traffic Server records.config file. Yes bestie, this is the Apache:...:Records(3) manual page from User Contributed Perl Documentation, and it's literally your little helper for reading, tweaking, and saving that config. πŸ’…

✨ SYNOPSIS ✨

okay so here's the whole vibe in Perl:

#!/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 implements a convenient interface to read, modify and save the records.config file as used by Apache Traffic Server. It's giving β€œI made the config manageable” and honestly? Iconic. ✨

If you instantiate a new Config::Records class with a file provided, it will automatically load that configuration. Don't call the load() method explicitly in this case β€” it already handled it, bestie.

🫢 little warning: don't call load() explicitly in this case β€” the construction already loaded it.

πŸŽ€ API Methods πŸŽ€

The following are methods in the Records class. Group-chat roll call, periodt: 🫑

πŸ¦‹ new

Instantiate a 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. (Yes, that's literally what it says β€” merge city, population: your config. 😭)

🐚 get

Get 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. So yes, you can use the shorties or the full words β€” the module gets it. πŸ’…

🧚 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

okay bye bestie πŸ«ΆπŸ’– β€” this page's footer says perl v5.32.1, dated 2026-10-20, manual title Apache:...:Records(3). Mwah! πŸ’‹

πŸ“¦ where this page comes from