Skip to main content
Version: 0.9.x

Lunar Commands

Discover

docker exec lunar-proxy discover

See Discover for more information.

Diagnose

The diagnose command is used to inspect HAR logs collected by Lunar and exported to file. Running the command without any arguments prints the number of logs and the time of the last log. If an index i is provided, the command will print the ith log, ordered by time in ascending order.

caution

The diagnose command only prints HAR logs which were exported to a file.

docker exec lunar-proxy diagnose
docker exec lunar-proxy diagnose <sample_index>

Examples:

$ diagnose

==== Diagnose ====

Inspect HAR samples exported by Lunar
Samples are ordered by time in ascending order

Usage: diagnose <sample-index>

Reading data from: /var/log/lunar-proxy/output.log

There are 4 samples
Last sample is from "2023-06-18T22:21:35.51002367Z"

$ diagnose 1

{
"log": {
"version": "1.2",
"creator": {
"name": "Lunar Har Exporter",
"version": "1.0",
"comment": ""
},
"entries": [
{
"startedDateTime": "2023-06-18T22:21:16.697899675Z",
# truncated for brevity, output continues
}
]
}
}

See Diagnose and HAR Log Collector for more information on diagnosis and collecting HAR logs.

Apply Policies

docker exec lunar-proxy apply_policies

For more information about the apply_policies command, please visit the Customize page.

Remedy Stats

docker exec lunar-proxy remedy_stats

Output Example:

{
"remedy_stats": [
{
"remedy": "response_based_throttling",
"action": "generated",
"affected_count": 5,
"affected_ratio": 0.23809,
"affected_stats_by_endpoint": [
{
"method": "POST",
"url": "some-api.com/v2/*",
"count": 5,
"count_by_status_code": {
"400": 5
}
}
]
},
{
"remedy": "strategy_based_throttling",
"action": "generated",
"affected_count": 3,
"affected_ratio": 0.14285,
"affected_stats_by_endpoint": [
{
"method": "GET",
"url": "another-api.com/{some-path-param}",
"count": 3,
"count_by_status_code": {
"429": 3
}
}
]
}
// further per-plugin statistics (e.g. `account_orchestration`)...
],
"remedy_action_stats": {
"generated": {
"count": 8,
"ratio": 0.38095,
"ratio_by_status_code": {
"419": 0.5
}
}
// further per-action statistics (e.g. `modified`)...
},
"max_epoch_millis": 1688394379367,
"min_epoch_millis": 1688394264386
}

For more information about the remedy_stats command, please visit the Remedy Statistics Report page.

Logs

docker logs lunar-proxy
Click me for guidance 😀