.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.48) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Apache::TS::Config::Records 3" .TH Apache::TS::Config::Records 3 2026-09-24 "perl v5.44.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Apache::TS::Config::Records \- Manage the Apache Traffic Server records.config file .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& #!/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"); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This module implements a convenient interface to read, modify and save the records.config file as used by Apache Traffic Server. .PP Instantiating a new Config::Records class, with a file provided, will automatically load that configuration. Don\*(Aqt call the \fBload()\fR method explicitly in this case. .SS "API Methods" .IX Subsection "API Methods" The following are methods in the Records class. .IP new 8 .IX Item "new" Instantiate a new object. The file name is optionally provided, and if present that file is immediately loaded (see the \fBload()\fR method below). Example: .Sp .Vb 1 \& my $r = new Apache::TS::Config::Records(file => $fname); .Ve .IP load 8 .IX Item "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 .IP get 8 .IX Item "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 .Sp .Vb 1 \& [, [value split into 4 fields, flag if changed] .Ve .Sp You probably shouldn\*(Aqt modify this array. .IP set 8 .IX Item "set" Modify one configuration value, with the provided value. Both the conf name and the value are required. Example: .Sp .Vb 2 \& $r\->set(conf => "proxy.config.exec_thread.autoconfig", \& val => "0"); .Ve .Sp conf is short for "config", val is short for "value", and all are acceptable. .IP remove 8 .IX Item "remove" Remove a specified configuration, the mandatory option is conf (or "config"). Example: .Sp .Vb 1 \& $r\->remove(conf => "proxy.config.exec_thread.autoconfig"); .Ve .IP append 8 .IX Item "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: .Sp .Vb 4 \& $r\->append(line => ""); \& $r\->append(line => "# My local stuff"); \& $r\->set(conf => "proxy.config.dns.dedicated_thread", \& val => "1"); .Ve .IP write 8 .IX Item "write" Write the new configuration file to STDOUT, or a filename if provided. Example: .Sp .Vb 1 \& $r\->write(file => "/etc/trafficserver/records.config"); .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" Apache::TS::Config