# axorouter-ctl

## Name

`axorouter-ctl` — Utility to control and troubleshoot AxoRouter

## Synopsis

`axorouter-ctl [command] [options]`

## Description

The `axorouter-ctl` application is a utility that is needed mainly for troubleshooting. For example, it can be used to:

  * [enable/disable troubleshooting messages](../../../docs/axoflow/reference/man-page/axorouter-ctl/index.md#control)
  * [display statistics](../../../docs/axoflow/reference/man-page/axorouter-ctl/index.md#stats) about the processed messages
  * [display version information](../../../docs/axoflow/reference/man-page/axorouter-ctl/index.md#version) of AxoRouter.



## Control syslog container

Usage: `axorouter-ctl control syslog <command> <options>`

This command allows you to access and control the syslog container of AxoRouter. Essentially, it’s a wrapper for the [`syslog-ng-ctl`](<https://axoflow.com/docs/axosyslog-core/app-man-syslog-ng/syslog-ng-ctl.1/>) command of AxoSyslog. Usually, you don’t have to use this command unless our support team instructs you to.

For example:

  * Enable debug messages for troubleshooting: `axorouter-ctl control syslog log-level verbose`
  * Display the current configuration: `axorouter-ctl control syslog config --preprocessed`
  * Reload the configuration: `axorouter-ctl control syslog reload`



For details, see the [AxoSyslog documentation](<https://axoflow.com/docs/axosyslog-core/app-man-syslog-ng/syslog-ng-ctl.1/>).

## Show logs

Usage: `axorouter-ctl logs <target> <journalctl-options>`

Displays the logs of the target container: `syslog`, `store` or `wec`. WEC logs are available only if the AxoRouter host has a ;[Windows Event Collector (WEC)](../../../docs/axoflow/data-sources/wec/index.md) connector configured.

The `axorouter-ctl logs` command is a wrapper for the `journalctl` command, so you can add regular [journalctl options](<https://man7.org/linux/man-pages/man1/journalctl.1.html>) to the command. For example, `-n 50` to show the 50 most recent lines: `axorouter-ctl logs syslog -n 50`

## Prune images

Usage: `axorouter-ctl prune`

Removes all unused images from the local store, similarly to `podman-image-prune`.

## Pull images

Usage: `axorouter-ctl pull`

Download images needed for AxoRouter. This is usually not needed unless you have a custom environment, for example, proxy settings or pull credentials that aren’t available when the AxoRouter container is run.

## Shell access to AxoRouter

Usage: `axorouter-ctl shell wec`

Open a shell into the target container (`syslog`, `store` or `wec`). Usually needed only for troubleshooting purposes, when requested by our support team.

## Statistics and metrics

Usage: `axorouter-ctl stats syslog <legacy|prometheus>`

Display the statistics and metrics of the syslog container in Prometheus or legacy format, from the underlying AxoSyslog process. For details, see the [AxoSyslog documentation](<https://axoflow.com/docs/axosyslog-core/app-man-syslog-ng/syslog-ng-ctl.1/#the-stats-command>).

## Access AxoStore database

Usage: `axorouter-ctl store`

**CAUTION:**

Access the database directly only when instructed by the support team, or if you know exactly what you’re doing. 

Start an interactive SQL session using the command-line [Clickhouse client](<https://clickhouse.com/docs/interfaces/cli>) to access data stored in AxoStore. Type `exit` to end the session.

## Version

Usage: `axorouter-ctl version`

Show the version numbers of the underlying AxoSyslog build, for example:
```
 
    0.58.0
    axosyslog 4 (4.11.0)
    Config version: 4.2
    Installer-Version: 4.11.0
    
```

## Wipe disk buffer files

Usage: `axorouter-ctl wipe [-a/--all]`

Deletes every corrupted and abandoned disk buffer files. Usually, you don’t have to use this command unless our support team instructs you to.

For disk buffer files containing messages, a backup copy is created into the `/root/diskqueue_backup` directory. To use a different directory for backups, set the `BACKUP_DIR` environment variable. This behavior can be overridden by the `-a` option, which deletes such files without making a backup. Empty disk buffer files are always deleted.