PMLOGREWRITE(1) General Commands Manual PMLOGREWRITE(1) (NAME) pmlogrewrite - Performance Co-Pilot (PCP) (SYNOPSIS) pmlogrewrite [-Cdiqsvw?] [-c config] [-D debug] [-V version] inlog [outlog] (DESCRIPTION) pmlogrewrite Performance Co-Pilot (PCP) inlog PCP outlog . -c ( (REWRITING RULES SYNTAX) ) inlog outlog . pmlogrewrite (PMDA) (instance domains) . (EXAMPLES) . pmlogrewrite (redact) PCP . pmlogrewrite pmlogredact(1) . pmlogrewrite PMDA pmlogextract(1) . pmlogrewrite pmlogextract(1) . inlog PCP pmlogger(1) PCP pmlogextract(1) pmlogreduce(1). inlog () . -c outlog inlog . cat(1) PCP . pmlogrewrite PCP pmlogrewrite pmloglabel(1) . (OPTIONS) : -c config, --config=config config (symlink) (parse) . config ( <<.>> ) . scandir(3) strcmp(3) . -c . -C, --check . outlog -C . -C -v -w config . -d, --desperate (Desperate mode). PCP outlog . -d outlog . -i outlog -i inlog (in-place) . inlog ( ) inlog . -q, --quick ( inlog ) pmlogrewrite () outlog . -s, --scale <<>> (scale factor) BYTE KBYTE MSEC-1 USEC-1 MBYTE.SEC-1 KBYTE.USEC-1. () inlog () . pmlogrewrite () . () -s . RESCALE UNITS EXTRAUNITS . -v, --verbose (verbose). -V version, --version=version PCP . . inlog version ( ). -V outlog inlog . -w, --warnings . pmlogrewrite ( ) . PMDA . pmlogrewrite inlog . inlog ( PMDA) . -w . -?, --help . outlog -i . (REWRITING RULES SYNTAX) . bolditalic (case-insensitive) METRIC metric Metric . <<#>> (comment) . ( ) . global () : GLOBAL { globalspec ... } globalspec (clause) : HOSTNAME -> hostname PCP outlog hostname . TIME -> delta PCP (timestamp) . delta delta <<+>> () <<->> <<:>> <<:>> <<.>> . <<30>> . <<-23:59:59.999>> . TIMEZONE -> "timezone" TZ -> "timezone" PCP outlog timezone . timezone (double quotes) Posix TZ AEST-10. tzset(3) . TZ TIMEZONE . ZONEINFO -> "zoneinfo" PCP outlog zoneinfo . zoneinfo zoneinfo /usr/share/zoneinfo :Africa/Timbuktu. tzset(3) . zoneinfo . FEATURES -> feature-bits PCP outlog pmlogger(1) <<>> feature-bits <<>> (OR) LOGARCHIVE(5) . feature-bits BITS() ( ) . : features -> bits(31,7,1) features . indom (instance domain) : INDOM domain.serial { indomspec ... } domain serial inlog domain serial . serial <<*>> domain . inlog . indomspec : INAME "oldname" -> "newname" oldname newname . oldname newname (double quotes) . DELETE ( ) oldname outlog (expunge) . PCP pmdaInstance(3) . : red eek urk INAME : "eek" -> "yellow like a flower" oldname "eek" "eek urk" . "red" -> "eek" newname "eek" "eek urk" . "eek urk" -> "red of another hue" newname "red of another hue" "red" . INAME REPLACE /pattern/ -> "replacement" (regular expression) pattern pattern replacement . pattern (Posix Extended Regular Expression regex(7) ) replacement s sed(1) & \1 \9 pattern . pattern replacement . pattern (/) (") . (\) regex(3) (literal) \( \[ \+ ... . replacement (") (/) . (\) & \ . . PCP . pmdaInstance(3) . : { iname replace /[a-z]*foo[a-z]*/ -> "FOO" } "foo" "FOO" { iname replace "([0-9]+) /.*/(.*)" -> "\1 \2" } ( proc PMDA) "2981799 /home/kenj/bin/foobar" "2981799 foobar" INAME REDACT "inst [redacted]" inst ASCII . INDOM -> newdomain.newserial . newserial <<*>> serial indom serial . : indom 29.* { indom -> 109.* } . INDOM -> DUPLICATE newdomain.newserial INDOM (duplicate) domain.serial indom newdomain.newserial . PMDA domain newdomain . foo.one foo.two 12.34 foo.two PMDA 27 : indom 12.34 { indom -> duplicate 27.34 } metric foo.two { indom -> 27.34 pmid -> 27.*.* } INST oldid -> newid oldid newid . oldid newid 231-1 . newid DELETE oldid outlog . metric : METRIC metricid { metricspec ... } metricid inlog PMID domain.cluster.item . domain cluster item . item <<*>> domain cluster cluster domain item cluster item domain . inlog . metricspec : DELETE outlog (expunge) . INDOM -> newdomain.newserial [ pick ] . outlog . pick . pick (indom PM_INDOM_NULL) 0 INST INAME . pick : OUTPUT FIRST OUTPUT LAST OUTPUT INST instid instid OUTPUT indom instid inlog OUTPUT INAME "name" name OUTPUT indom name inlog OUTPUT MIN ( 0 ) OUTPUT MAX ( 0 ) OUTPUT SUM ( 0 ) OUTPUT AVG ( 0 ) (indom PM_INDOM_NULL) pick FIRST LAST MIN MAX SUM AVG 0 . INDOM . INDOM indom metric . sample.bin 29.2 inlog ( ): indom 29.* { indom -> 109.* } metric sample.bin { indom -> 109.2 } sample.bin : indom 29.* { indom -> 109.* } metric sample.bin { indom -> 123.2 } INDOM -> NULL[ pick ] ( ) (singular) . . pick INDOM (non-NULL) . pick OUTPUT FIRST . NAME -> newname NAME -> newname DUPOK PCP (PMNS) . newname PMNS(5) . newname PMNS DUPOK foo -> mumble mumble -> fratz fratz -> foo. PMID -> newdomain.newcluster.newitem PMID . newcluster <<*>> cluster metric / item item metric . cluster / item . : metric 30.*.* { pmid -> 123.*.* } . SEM -> newsem (semantics) . newsem XXX PM_SEM_XXX pmLookupDesc(3) COUNTER PM_TYPE_COUNTER. SEM PMDA . pmlogreduce(1) . TYPE -> newtype . newtype XXX PM_TYPE_XXX pmLookupDesc(3) FLOAT PM_TYPE_FLOAT. PM_TYPE_STRING PM_TYPE_AGGREGATE PM_TYPE_EVENT PM_TYPE_HIGHRES_EVENT . PM_TYPE_STRING . (integer overflow) float double . TYPE IF oldtype -> newtype TYPE newtype inlog oldtype . metricid inlog . UNITS -> newunits [ RESCALE ] newunits . 0 1 -1 . . 0 ( 0 ) XXX PM_SPACE_XXX KBYTE PM_TYPE_KBYTE. 0 ( 0 ) XXX PM_TIME_XXX SEC PM_TIME_SEC. 0 ( 0 ) ONE PM_COUNT_ONE . PM_SPACE_XXX PM_TIME_XXX PM_COUNT_XXX pmLookupDesc(3) . ( ) RESCALE -s . EXTRAUNITS -> newextraunits [ RESCALE ] UNITS newextraunits . newunits UNITS . <<>> 0 ( ) XXX PM_UNIT_XXX TEMPERATURE PM_UNIT_TEMPERATURE. <<>> 0 ( ) XXX PM__XXX C PM_TEMPERATURE_C ( ). RESCALE UNITS . VALUE REPLACE /pattern/ -> "replacement" pattern pattern replacement . pattern ( regex(7) ) replacement s sed(1) & \1 \9 pattern . pattern replacement . pattern (/) (") . (\) regex(3) \( \[ \+ ... . replacement (") (/) . (\) & \ . . REPLACE . PM_TYPE_STRING . : { value /.*/ -> "" } value "/.*/(.*)" -> "\1" } "mumble /home/kenj/bin/foobar fumble" "mumble foobar fumble" PMDA . $PCP_VAR_DIR/pmns/stdpmid PMDA . text (help text) : TEXT textid [ texttype ] [ "textcontent" ] { textspec ... } textid METRIC metricid INDOM domain.serial . metricid METRIC ( ) domain.serial INDOM ( ). texttype : ONELINE HELP ALL <<*>> . texttype ONELINE . textcontent . <<\>> . inlog . textspec : DELETE outlog . INDOM -> newdomain.newserial . newserial <<*>> serial text serial . : text indom 29.* all { indom -> 109.* } . METRIC -> newdomain.newcluster.newitem . newcluster <<*>> cluster text / item item text . cluster / item . : text metric 30.*.* all { metric -> 123.*.* } . TEXT -> "new-text" new-text . label (label record) : LABEL labelid [ instance ] [ "label-name" ] [ "label-value" ] { labelspec ... } labelid (global context) : CONTEXT DOMAIN domainid CLUSTER domainid.clusterid ITEM metricid INDOM domain.serial INSTANCES domain.serial. metricid METRIC ( ). clusterid <<*>> domainid metricid . domain.serial INDOM ( ). labelid INSTANCES instance . <<*>> . . PCP pmdaInstance(3) . "label-name" / "label-value" / . <<*>> / . inlog . labelspec : DELETE outlog . NEW "new-label-name" "new-label-value" "new- label-name" "new-label-value" labelid instance ( INSTANCES labelid) . "label-name" "label- value" . instance labelid INSTANCES . LABEL -> "new-label-name" "new-label-name" . VALUE -> "new-label-value" "new-label-value" . DOMAIN -> newdomain . : label domain 30 { domain -> 123 } . CLUSTER -> newdomain.newcluster . newcluster <<*>> cluster label . cluster . : label cluster 30.* { cluster -> 123.* } . ITEM -> newdomain.newcluster.newitem . newcluster <<*>> cluster label / item item label . cluster / item . : label item 30.*.* { item -> 123.*.* } . INDOM -> newdomain.newserial . newserial <<*>> serial label serial . : label indom 29.* { indom -> 109.* } . INSTANCES -> newdomain.newserial INDOM . (EXAMPLES) IOPS PMDA : metric disk.dev.read { type -> U64 } metric disk.dev.write { type -> U64 } metric disk.dev.total { type -> U64 } kernel.all.load : # Linux PMDA kernel.all.load # 60.2 indom 60.2 { inst 1 -> 60 iname "1 minute" -> "60 second" inst 5 -> 300 iname "5 minute" -> "300 second" inst 15 -> 900 iname "15 minute" -> "900 second" } <> Linux PMDA PMID . PMDA : # proc metric 60.8.* { pmid -> 123.*.* } metric 60.9.* { pmid -> 123.*.* } metric 60.13.* { pmid -> 123.*.* } metric 60.24.* { pmid -> 123.*.* } metric 60.31.* { pmid -> 123.*.* } metric 60.32.* { pmid -> 123.*.* } metric 60.51.* { pmid -> 123.*.* } # proc indom 60.9 { indom -> 123.0 } foo.count_em <> . : metric foo.count_em { type if 32 -> U32 type if 64 -> U64 } (DIAGNOSTICS) pmlogrewrite stderr ( ) . (corrupted) ( pmlogger ) pmlogrewrite . << >> (empty archive) . pmlogrewrite . (FILES) inlog outlog : archive.meta ( ) archive.0 ( 1 2 ... ). archive.index (temporal index) . PCP (PCP ENVIRONMENT) PCP_ PCP . /etc/pcp.conf . $PCP_CONF pcp.conf(5) . PCP pmGetOptions(3) . (DEBUGGING OPTIONS) -D --debug stderr . debug pmdbg(1) -l . pmlogrewrite : +-------+--------------------------------------------------------------+ |Option | Description | +-------+--------------------------------------------------------------+ |appl0 | | | | | | | | +-------+--------------------------------------------------------------+ |appl1 | | | | ( | | | | | | | | | ) | +-------+--------------------------------------------------------------+ |appl2 | | | | (pmResult) | +-------+--------------------------------------------------------------+ |appl3 | -q | | | | | | | | | | +-------+--------------------------------------------------------------+ |appl4 | | | | config | +-------+--------------------------------------------------------------+ |appl5 | regex(7) | | | | | | | +-------+--------------------------------------------------------------+ |appl6 | | | | | | | config | +-------+--------------------------------------------------------------+ |appl7 | | | | (temporal | | | index) | +-------+--------------------------------------------------------------+ (SEE ALSO) PCPIntro(1), pmlogdump(1), pmlogextract(1), pmlogger(1), pmloglabel(1), pmlogredact(1), pmlogreduce(1), PMAPI(3), pmLookupDesc(3), pmdaInstance(3), scandir(3), tzset(3), LOGARCHIVE(5), PMNS(5), pcp.conf(5), pcp.env(5) regex(7). Performance Co-Pilot PMLOGREWRITE(1)