Skip to content

Commit

Permalink
Kathia's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wojcik-dorota committed Mar 12, 2024
1 parent 96018f6 commit 52553c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 39 deletions.
6 changes: 2 additions & 4 deletions docs/products/postgresql/concepts/pg-audit-logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ Aiven for PostgreSQL® audit logging requires the following:
To use the audit logging on your service (database) for collecting logs in Aiven for
PostgreSQL, you need to
[enable and configure this feature](/docs/products/postgresql/howto/use-pg-audit-logging)
using the [Aiven Console](https://console.aiven.io), the
[Aiven API](https://api.aiven.io/doc/), the [Aiven CLI](/docs/tools/cli), or
using the [Aiven Console](https://console.aiven.io), the [Aiven CLI](/docs/tools/cli), or
[psql](https://www.postgresql.org/docs/current/app-psql.html).

### Configuration options
Expand Down Expand Up @@ -187,8 +186,7 @@ use [OpenSearch Dashboards](/docs/products/opensearch/dashboards).
To
[disable the audit logging on your service (database)](/docs/products/postgresql/howto/use-pg-audit-logging),
you need to modify your service's advanced configuration with the
[Aiven Console](https://console.aiven.io), the [Aiven API](https://api.aiven.io/doc/), the
[Aiven CLI](/docs/tools/cli), or
[Aiven Console](https://console.aiven.io), the [Aiven CLI](/docs/tools/cli), or
[psql](https://www.postgresql.org/docs/current/app-psql.html).

## What's next
Expand Down
41 changes: 6 additions & 35 deletions docs/products/postgresql/howto/use-pg-audit-logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ Enable and configure the [Aiven for PostgreSQL® audit logging feature](/docs/pr
- `avnadmin` superuser role
- Dev tool of your choice to interact with the feature
- [Aiven Console](https://console.aiven.io/)
- [Aiven API](https://api.aiven.io/doc/)
([Aiven API Postman collection](https://www.postman.com/aiven-apis/workspace/aiven/collection/21112408-1f6306ef-982e-49f8-bdae-4d9fdadbd6cd))
- [Aiven CLI client](/docs/tools/cli)
- [psql](https://www.postgresql.org/docs/current/app-psql.html) for advanced
configuration
Expand Down Expand Up @@ -112,15 +110,6 @@ or for a database-role combination.
```sql
SELECT aiven_extras.set_pgaudit_role_parameter('log', ROLE_NAME, 'ddl');
```

#### Enable on a DB for a user

1. [Connect to your Aiven for PostgreSQL service](/docs/products/postgresql/howto/list-code-samples).
1. Run the following query:

```sql
SELECT aiven_extras.set_pgaudit_parameter('log', DATABASE_NAME, ROLE_NAME, 'ddl');
```
</TabItem>
</Tabs>

Expand Down Expand Up @@ -209,7 +198,7 @@ psql allows for fine-grained configuration of audit logging: on a database, for
1. Run the following query:

```sql
ALTER DATABASE DATABASE_NAME SET pgaudit.log_PARAMETER_NAME = PARAMETER_VALUE
SELECT aiven_extras.set_pgaudit_parameter(PARAMETER_NAME, DATABASE_NAME, ROLE_NAME, PARAMETER_VALUE);
```

#### Configure for a user
Expand All @@ -218,16 +207,7 @@ psql allows for fine-grained configuration of audit logging: on a database, for
1. Run the following query:

```sql
ALTER ROLE ROLE_NAME SET pgaudit.log_PARAMETER_NAME = PARAMETER_VALUE
```

#### Configure on a DB for a user

1. [Connect to your Aiven for PostgreSQL service](/docs/products/postgresql/howto/list-code-samples).
1. Run the following query:

```sql
ALTER ROLE ROLE_NAME IN DATABASE DATABASE_NAME SET pgaudit.log_PARAMETER_NAME = PARAMETER_VALUE
SELECT aiven_extras.set_pgaudit_role_parameter(PARAMETER_NAME, ROLE_NAME, PARAMETER_VALUE);
```
</TabItem>
</Tabs>
Expand Down Expand Up @@ -258,8 +238,8 @@ For more details on how to set up, configure, and use session audit logging, che

## Access your logs

You can access your Aiven for PostgreSQL audit logs either [directly in the log output of
your service](#access-pg-log) or by
You can access your Aiven for PostgreSQL audit logs either
[directly in the log output of your service](#access-pg-log) or by
[integrating with another service that allows monitoring and analyzing logs, such as Aiven for OpenSearch®](#access-in-integration).

### Access in Aiven for PostgreSQL {#access-pg-log}
Expand Down Expand Up @@ -414,7 +394,7 @@ database-role combination.
1. Run the following query:

```sql
ALTER DATABASE DATABASE_NAME set pgaudit.featureEnabled = 'off'
SELECT aiven_extras.set_pgaudit_parameter('log', DATABASE_NAME, ROLE_NAME, 'none');
```

#### Disable for a user
Expand All @@ -423,16 +403,7 @@ database-role combination.
1. Run the following query:

```sql
ALTER ROLE ROLE_NAME SET pgaudit.featureEnabled = 'off'
```

#### Disable on a DB for a user

1. [Connect to your Aiven for PostgreSQL service](/docs/products/postgresql/howto/list-code-samples).
1. Run the following query:

```sql
ALTER ROLE ROLE_NAME IN DATABASE DATABASE_NAME SET pgaudit.featureEnabled = 'off'
SELECT aiven_extras.set_pgaudit_role_parameter('log', ROLE_NAME, 'none');
```
</TabItem>
</Tabs>

0 comments on commit 52553c4

Please sign in to comment.