--- layout: docs page_title: "audit enable - Vault CLI" description: >- Create and enable a new audit device to capture log data from Vault. --- > [!IMPORTANT] > **Documentation Update:** Product documentation, which were located in this repository under `/website`, are now located in [`hashicorp/web-unified-docs`](https://github.com/hashicorp/web-unified-docs), colocated with all other product documentation. Contributions to this content should be done in the `web-unified-docs` repo, and not this one. Changes made to `/website` content in this repo will not be reflected on the developer.hashicorp.com website. # `audit enable` Enable a new audit device. ```shell-session $ vault audit enable [flags] [options] [...] $ vault audit enable [-help | -h] ``` ## Description `audit enable` creates and enables an audit device at the given path or returns an error if an audit device already exists at the given path. The device configuration parameters depend on the audit device type. EnableAuditDevice - [`POST:/sys/audit/{mount-path}`](/vault/api-docs/system/audit#enable-audit-device) ## Command arguments @include 'cli/audit/args/device_type.mdx' Each audit device type also has a set of configuration arguments: ```shell-session $ vault audit enable [flags] file [options] \ file_path= \ [mode=] ```
@include 'cli/audit/args/file/file_path.mdx'


@include 'cli/audit/args/file/mode.mdx'
```shell-session $ vault audit enable [flags] socket [options] \ [address=] \ [socket_type=] \ [write_timeout=] ```
@include 'cli/audit/args/socket/address.mdx'


@include 'cli/audit/args/socket/socket_type.mdx'


@include 'cli/audit/args/socket/write_timeout.mdx'
```shell-session $ vault audit enable [flags] syslog [options] \ [facility=] \ [tag=] ```
@include 'cli/audit/args/syslog/facility.mdx'


@include 'cli/audit/args/syslog/tag.mdx'
## Command options
@include 'cli/audit/options/elide_list_responses.mdx'


@include 'cli/audit/options/exclude.mdx'


@include 'cli/audit/options/fallback.mdx'


@include 'cli/audit/options/filter.mdx'


@include 'cli/audit/options/format.mdx'


@include 'cli/audit/options/hmac_accessor.mdx'


@include 'cli/audit/options/log_raw.mdx'


@include 'cli/audit/options/prefix.mdx' ## Command flags
@include 'cli/audit/flags/description.mdx'


@include 'cli/audit/flags/local.mdx'


@include 'cli/audit/flags/path.mdx' ## Standard flags
@include 'cli/standard-settings/all-standard-flags-but-format.mdx' ## Examples Enable a `file` type audit device at the default path, `file/`: ```shell-session $ vault audit enable file file_path=/tmp/my-file.txt Success! Enabled the file audit device at: file/ ``` Enable a `file` type audit device at the path, `audit/file`: ```shell-session $ vault audit enable -path=audit/file file file_path=/tmp/my-file.txt Success! Enabled the file audit device at: audit/file/ ```