# alp ![Test](https://github.com/tkuchiki/alp/workflows/Test/badge.svg?branch=master) alp is Access Log Profiler [日本語](./README.ja.md) # Installation ### Binary distribution You can pick your download [here](https://github.com/tkuchiki/alp/releases), and install it as follows: ```bash sudo install /usr/local/bin/alp ``` ### Using your distribution's package system #### macOS (Homebrew) Install alp with Homebrew - `brew install alp` ### asdf Install alp with [asdf](https://github.com/asdf-vm/asdf) and [asdf-alp](https://github.com/asdf-community/asdf-alp) ```bash asdf plugin-add alp https://github.com/asdf-community/asdf-alp.git asdf install alp asdf global alp ``` # The difference between v0.4.0 and v1.0.0 See: [The difference between v0.4.0 and v1.0.0](./docs/the_difference_between_v0_4_0_and_v1_0_0.md) # Usage ```console $ alp --help alp is the access log profiler for LTSV, JSON, Pcap, and others. Usage: alp [flags] alp [command] Available Commands: completion Generate the autocompletion script for the specified shell count Count by log entries diff Show the difference between the two profile results help Help about any command json Profile the logs for JSON ltsv Profile the logs for LTSV pcap Profile the HTTP requests for captured packets regexp Profile the logs that match a regular expression Flags: -h, --help help for alp -v, --version version for alp Use "alp [command] --help" for more information about a command. $ alp ltsv --help Profile the logs for LTSV Usage: alp ltsv [flags] Flags: --apptime-label string Change the apptime label (default "apptime") --config string The configuration file --decode-uri Decode the URI --dump string Dump profiled data as YAML --file string The slowlog file -f, --filters string Only the logs are profiled that match the conditions --format string The output format (table, markdown, tsv, csv and html) (default "table") -h, --help help for ltsv --limit int The maximum number of results to display (default 5000) --load string Load the profiled YAML data --location string Location name for the timezone (default "Local") -m, --matching-groups string Specifies Query matching groups separated by commas --method-label string Change the method label (default "method") --noheaders Output no header line at all (only --format=tsv, csv) --nosave-pos Do not save position file -o, --output string Specifies the results to display, separated by commas (default "all") --page int Number of pages of pagination (default 100) --percentiles string Specifies the percentiles separated by commas --pos string The position file --qs-ignore-values Ignore the value of the query string. Replace all values with xxx (only use with -q) -q, --query-string Include the URI query string --reqtime-label string Change the reqtime label (default "reqtime") -r, --reverse Sort results in reverse order --show-footers Output footer line at all (only --format=table, markdown) --size-label string Change the size label (default "size") --sort string Output the results in sorted order (default "count") --status-label string Change the status label (default "status") --time-label string Change the time label (default "time") --uri-label string Change the uri label (default "uri") $ alp json --help Profile the logs for JSON Usage: alp json [flags] Flags: --body-bytes-key string Change the body_bytes key (default "body_bytes") --config string The configuration file --decode-uri Decode the URI --dump string Dump profiled data as YAML --file string The slowlog file -f, --filters string Only the logs are profiled that match the conditions --format string The output format (table, markdown, tsv, csv and html) (default "table") -h, --help help for json --limit int The maximum number of results to display (default 5000) --load string Load the profiled YAML data --location string Location name for the timezone (default "Local") -m, --matching-groups string Specifies Query matching groups separated by commas --method-key string Change the method key (default "method") --noheaders Output no header line at all (only --format=tsv, csv) --nosave-pos Do not save position file -o, --output string Specifies the results to display, separated by commas (default "all") --page int Number of pages of pagination (default 100) --percentiles string Specifies the percentiles separated by commas --pos string The position file --qs-ignore-values Ignore the value of the query string. Replace all values with xxx (only use with -q) -q, --query-string Include the URI query string --reqtime-key string Change the request_time key (default "request_time") --restime-key string Change the response_time key (default "response_time") -r, --reverse Sort results in reverse order --show-footers Output footer line at all (only --format=table, markdown) --sort string Output the results in sorted order (default "count") --status-key string Change the status key (default "status") --time-key string Change the time key (default "time") --uri-key string Change the uri key (default "uri") $ alp regexp --help Profile the logs that match a regular expression Usage: alp regexp [flags] Flags: --body-bytes-subexp string Change the body_bytes sub expression (default "body_bytes") --config string The configuration file --decode-uri Decode the URI --dump string Dump profiled data as YAML --file string The slowlog file -f, --filters string Only the logs are profiled that match the conditions --format string The output format (table, markdown, tsv, csv and html) (default "table") -h, --help help for regexp --limit int The maximum number of results to display (default 5000) --load string Load the profiled YAML data --location string Location name for the timezone (default "Local") -m, --matching-groups string Specifies Query matching groups separated by commas --method-subexp string Change the method sub expression (default "method") --noheaders Output no header line at all (only --format=tsv, csv) --nosave-pos Do not save position file -o, --output string Specifies the results to display, separated by commas (default "all") --page int Number of pages of pagination (default 100) --pattern string Regular expressions pattern matching the log (default "^(\\S+)\\s\\S+\\s+(\\S+\\s+)+\\[(?P