tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack
tencentcloud.getCynosdbAuditLogs
Explore with Pulumi AI
tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack
Use this data source to query detailed information of cynosdb audit_logs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const auditLogs = tencentcloud.getCynosdbAuditLogs({
endTime: "2023-06-18 10:00:02",
filter: {
hosts: ["30.50.207.176"],
policyNames: ["default_audit"],
sql: "SELECT @@max_allowed_packet",
sqlType: "SELECT",
users: ["keep_dts"],
},
instanceId: "cynosdbmysql-ins-afqx1hy0",
order: "DESC",
orderBy: "timestamp",
startTime: "2023-06-18 10:00:00",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
audit_logs = tencentcloud.get_cynosdb_audit_logs(end_time="2023-06-18 10:00:02",
filter={
"hosts": ["30.50.207.176"],
"policy_names": ["default_audit"],
"sql": "SELECT @@max_allowed_packet",
"sql_type": "SELECT",
"users": ["keep_dts"],
},
instance_id="cynosdbmysql-ins-afqx1hy0",
order="DESC",
order_by="timestamp",
start_time="2023-06-18 10:00:00")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.GetCynosdbAuditLogs(ctx, &tencentcloud.GetCynosdbAuditLogsArgs{
EndTime: "2023-06-18 10:00:02",
Filter: tencentcloud.GetCynosdbAuditLogsFilter{
Hosts: []string{
"30.50.207.176",
},
PolicyNames: []string{
"default_audit",
},
Sql: pulumi.StringRef("SELECT @@max_allowed_packet"),
SqlType: pulumi.StringRef("SELECT"),
Users: []string{
"keep_dts",
},
},
InstanceId: "cynosdbmysql-ins-afqx1hy0",
Order: pulumi.StringRef("DESC"),
OrderBy: pulumi.StringRef("timestamp"),
StartTime: "2023-06-18 10:00:00",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var auditLogs = Tencentcloud.GetCynosdbAuditLogs.Invoke(new()
{
EndTime = "2023-06-18 10:00:02",
Filter = new Tencentcloud.Inputs.GetCynosdbAuditLogsFilterInputArgs
{
Hosts = new[]
{
"30.50.207.176",
},
PolicyNames = new[]
{
"default_audit",
},
Sql = "SELECT @@max_allowed_packet",
SqlType = "SELECT",
Users = new[]
{
"keep_dts",
},
},
InstanceId = "cynosdbmysql-ins-afqx1hy0",
Order = "DESC",
OrderBy = "timestamp",
StartTime = "2023-06-18 10:00:00",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetCynosdbAuditLogsArgs;
import com.pulumi.tencentcloud.inputs.GetCynosdbAuditLogsFilterArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var auditLogs = TencentcloudFunctions.getCynosdbAuditLogs(GetCynosdbAuditLogsArgs.builder()
.endTime("2023-06-18 10:00:02")
.filter(GetCynosdbAuditLogsFilterArgs.builder()
.hosts("30.50.207.176")
.policyNames("default_audit")
.sql("SELECT @@max_allowed_packet")
.sqlType("SELECT")
.users("keep_dts")
.build())
.instanceId("cynosdbmysql-ins-afqx1hy0")
.order("DESC")
.orderBy("timestamp")
.startTime("2023-06-18 10:00:00")
.build());
}
}
variables:
auditLogs:
fn::invoke:
function: tencentcloud:getCynosdbAuditLogs
arguments:
endTime: 2023-06-18 10:00:02
filter:
hosts:
- 30.50.207.176
policyNames:
- default_audit
sql: SELECT @@max_allowed_packet
sqlType: SELECT
users:
- keep_dts
instanceId: cynosdbmysql-ins-afqx1hy0
order: DESC
orderBy: timestamp
startTime: 2023-06-18 10:00:00
Using getCynosdbAuditLogs
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getCynosdbAuditLogs(args: GetCynosdbAuditLogsArgs, opts?: InvokeOptions): Promise<GetCynosdbAuditLogsResult>
function getCynosdbAuditLogsOutput(args: GetCynosdbAuditLogsOutputArgs, opts?: InvokeOptions): Output<GetCynosdbAuditLogsResult>
def get_cynosdb_audit_logs(end_time: Optional[str] = None,
filter: Optional[GetCynosdbAuditLogsFilter] = None,
id: Optional[str] = None,
instance_id: Optional[str] = None,
order: Optional[str] = None,
order_by: Optional[str] = None,
result_output_file: Optional[str] = None,
start_time: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetCynosdbAuditLogsResult
def get_cynosdb_audit_logs_output(end_time: Optional[pulumi.Input[str]] = None,
filter: Optional[pulumi.Input[GetCynosdbAuditLogsFilterArgs]] = None,
id: Optional[pulumi.Input[str]] = None,
instance_id: Optional[pulumi.Input[str]] = None,
order: Optional[pulumi.Input[str]] = None,
order_by: Optional[pulumi.Input[str]] = None,
result_output_file: Optional[pulumi.Input[str]] = None,
start_time: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetCynosdbAuditLogsResult]
func GetCynosdbAuditLogs(ctx *Context, args *GetCynosdbAuditLogsArgs, opts ...InvokeOption) (*GetCynosdbAuditLogsResult, error)
func GetCynosdbAuditLogsOutput(ctx *Context, args *GetCynosdbAuditLogsOutputArgs, opts ...InvokeOption) GetCynosdbAuditLogsResultOutput
> Note: This function is named GetCynosdbAuditLogs
in the Go SDK.
public static class GetCynosdbAuditLogs
{
public static Task<GetCynosdbAuditLogsResult> InvokeAsync(GetCynosdbAuditLogsArgs args, InvokeOptions? opts = null)
public static Output<GetCynosdbAuditLogsResult> Invoke(GetCynosdbAuditLogsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetCynosdbAuditLogsResult> getCynosdbAuditLogs(GetCynosdbAuditLogsArgs args, InvokeOptions options)
public static Output<GetCynosdbAuditLogsResult> getCynosdbAuditLogs(GetCynosdbAuditLogsArgs args, InvokeOptions options)
fn::invoke:
function: tencentcloud:index/getCynosdbAuditLogs:getCynosdbAuditLogs
arguments:
# arguments dictionary
The following arguments are supported:
- End
Time This property is required. string - The end time is in the format of 2017-07-12 10:29:20.
- Instance
Id This property is required. string - Instance ID.
- Start
Time This property is required. string - Start time, format: 2017-07-12 10:29:20.
- Filter
Get
Cynosdb Audit Logs Filter - Filter conditions. You can filter logs according to the set filtering criteria.
- Id string
- Order string
- Sort by. The supported values include: ASC - ascending order, DESC - descending order.
- Order
By string - Sort fields. The supported values include: timestamp - timestamp; 'effectRows' - affects the number of rows; 'execTime' - Execution time.
- Result
Output stringFile - Used to save results.
- End
Time This property is required. string - The end time is in the format of 2017-07-12 10:29:20.
- Instance
Id This property is required. string - Instance ID.
- Start
Time This property is required. string - Start time, format: 2017-07-12 10:29:20.
- Filter
Get
Cynosdb Audit Logs Filter - Filter conditions. You can filter logs according to the set filtering criteria.
- Id string
- Order string
- Sort by. The supported values include: ASC - ascending order, DESC - descending order.
- Order
By string - Sort fields. The supported values include: timestamp - timestamp; 'effectRows' - affects the number of rows; 'execTime' - Execution time.
- Result
Output stringFile - Used to save results.
- end
Time This property is required. String - The end time is in the format of 2017-07-12 10:29:20.
- instance
Id This property is required. String - Instance ID.
- start
Time This property is required. String - Start time, format: 2017-07-12 10:29:20.
- filter
Get
Cynosdb Audit Logs Filter - Filter conditions. You can filter logs according to the set filtering criteria.
- id String
- order String
- Sort by. The supported values include: ASC - ascending order, DESC - descending order.
- order
By String - Sort fields. The supported values include: timestamp - timestamp; 'effectRows' - affects the number of rows; 'execTime' - Execution time.
- result
Output StringFile - Used to save results.
- end
Time This property is required. string - The end time is in the format of 2017-07-12 10:29:20.
- instance
Id This property is required. string - Instance ID.
- start
Time This property is required. string - Start time, format: 2017-07-12 10:29:20.
- filter
Get
Cynosdb Audit Logs Filter - Filter conditions. You can filter logs according to the set filtering criteria.
- id string
- order string
- Sort by. The supported values include: ASC - ascending order, DESC - descending order.
- order
By string - Sort fields. The supported values include: timestamp - timestamp; 'effectRows' - affects the number of rows; 'execTime' - Execution time.
- result
Output stringFile - Used to save results.
- end_
time This property is required. str - The end time is in the format of 2017-07-12 10:29:20.
- instance_
id This property is required. str - Instance ID.
- start_
time This property is required. str - Start time, format: 2017-07-12 10:29:20.
- filter
Get
Cynosdb Audit Logs Filter - Filter conditions. You can filter logs according to the set filtering criteria.
- id str
- order str
- Sort by. The supported values include: ASC - ascending order, DESC - descending order.
- order_
by str - Sort fields. The supported values include: timestamp - timestamp; 'effectRows' - affects the number of rows; 'execTime' - Execution time.
- result_
output_ strfile - Used to save results.
- end
Time This property is required. String - The end time is in the format of 2017-07-12 10:29:20.
- instance
Id This property is required. String - Instance ID.
- start
Time This property is required. String - Start time, format: 2017-07-12 10:29:20.
- filter Property Map
- Filter conditions. You can filter logs according to the set filtering criteria.
- id String
- order String
- Sort by. The supported values include: ASC - ascending order, DESC - descending order.
- order
By String - Sort fields. The supported values include: timestamp - timestamp; 'effectRows' - affects the number of rows; 'execTime' - Execution time.
- result
Output StringFile - Used to save results.
getCynosdbAuditLogs Result
The following output properties are available:
- End
Time string - Id string
- Instance
Id string - Items
List<Get
Cynosdb Audit Logs Item> - Audit log details. Note: This field may return null, indicating that a valid value cannot be obtained.
- Start
Time string - Filter
Get
Cynosdb Audit Logs Filter - Order string
- Order
By string - Result
Output stringFile
- End
Time string - Id string
- Instance
Id string - Items
[]Get
Cynosdb Audit Logs Item - Audit log details. Note: This field may return null, indicating that a valid value cannot be obtained.
- Start
Time string - Filter
Get
Cynosdb Audit Logs Filter - Order string
- Order
By string - Result
Output stringFile
- end
Time String - id String
- instance
Id String - items
List<Get
Cynosdb Audit Logs Item> - Audit log details. Note: This field may return null, indicating that a valid value cannot be obtained.
- start
Time String - filter
Get
Cynosdb Audit Logs Filter - order String
- order
By String - result
Output StringFile
- end
Time string - id string
- instance
Id string - items
Get
Cynosdb Audit Logs Item[] - Audit log details. Note: This field may return null, indicating that a valid value cannot be obtained.
- start
Time string - filter
Get
Cynosdb Audit Logs Filter - order string
- order
By string - result
Output stringFile
- end_
time str - id str
- instance_
id str - items
Sequence[Get
Cynosdb Audit Logs Item] - Audit log details. Note: This field may return null, indicating that a valid value cannot be obtained.
- start_
time str - filter
Get
Cynosdb Audit Logs Filter - order str
- order_
by str - result_
output_ strfile
- end
Time String - id String
- instance
Id String - items List<Property Map>
- Audit log details. Note: This field may return null, indicating that a valid value cannot be obtained.
- start
Time String - filter Property Map
- order String
- order
By String - result
Output StringFile
Supporting Types
GetCynosdbAuditLogsFilter
- Affect
Rows double - Affects the number of rows. Indicates that filtering affects audit logs with rows greater than this value.
- Db
Names List<string> - Database name.
- Exec
Time double - Execution time. Unit: ms. Indicates audit logs with a filter execution time greater than this value.
- Hosts List<string>
- Client address.
- Policy
Names List<string> - Audit policy name.
- Sent
Rows double - Returns the number of rows.
- Sql string
- SQL statement. Supports fuzzy matching.
- Sql
Type string - SQL type. Currently supported: SELECT, Insert, UPDATE, DELETE, CREATE, DROP, ALT, SET, REPLACE, EXECUTE.
- Sql
Types List<string> - SQL type. Supports simultaneous querying of multiple types. Currently supported: SELECT, Insert, UPDATE, DELETE, CREATE, DROP, ALT, SET, REPLACE, EXECUTE.
- Sqls List<string>
- SQL statement. Supports passing multiple SQL statements.
- Table
Names List<string> - Table name.
- Thread
Ids List<string> - Thread ID.
- Users List<string>
- User name.
- Affect
Rows float64 - Affects the number of rows. Indicates that filtering affects audit logs with rows greater than this value.
- Db
Names []string - Database name.
- Exec
Time float64 - Execution time. Unit: ms. Indicates audit logs with a filter execution time greater than this value.
- Hosts []string
- Client address.
- Policy
Names []string - Audit policy name.
- Sent
Rows float64 - Returns the number of rows.
- Sql string
- SQL statement. Supports fuzzy matching.
- Sql
Type string - SQL type. Currently supported: SELECT, Insert, UPDATE, DELETE, CREATE, DROP, ALT, SET, REPLACE, EXECUTE.
- Sql
Types []string - SQL type. Supports simultaneous querying of multiple types. Currently supported: SELECT, Insert, UPDATE, DELETE, CREATE, DROP, ALT, SET, REPLACE, EXECUTE.
- Sqls []string
- SQL statement. Supports passing multiple SQL statements.
- Table
Names []string - Table name.
- Thread
Ids []string - Thread ID.
- Users []string
- User name.
- affect
Rows Double - Affects the number of rows. Indicates that filtering affects audit logs with rows greater than this value.
- db
Names List<String> - Database name.
- exec
Time Double - Execution time. Unit: ms. Indicates audit logs with a filter execution time greater than this value.
- hosts List<String>
- Client address.
- policy
Names List<String> - Audit policy name.
- sent
Rows Double - Returns the number of rows.
- sql String
- SQL statement. Supports fuzzy matching.
- sql
Type String - SQL type. Currently supported: SELECT, Insert, UPDATE, DELETE, CREATE, DROP, ALT, SET, REPLACE, EXECUTE.
- sql
Types List<String> - SQL type. Supports simultaneous querying of multiple types. Currently supported: SELECT, Insert, UPDATE, DELETE, CREATE, DROP, ALT, SET, REPLACE, EXECUTE.
- sqls List<String>
- SQL statement. Supports passing multiple SQL statements.
- table
Names List<String> - Table name.
- thread
Ids List<String> - Thread ID.
- users List<String>
- User name.
- affect
Rows number - Affects the number of rows. Indicates that filtering affects audit logs with rows greater than this value.
- db
Names string[] - Database name.
- exec
Time number - Execution time. Unit: ms. Indicates audit logs with a filter execution time greater than this value.
- hosts string[]
- Client address.
- policy
Names string[] - Audit policy name.
- sent
Rows number - Returns the number of rows.
- sql string
- SQL statement. Supports fuzzy matching.
- sql
Type string - SQL type. Currently supported: SELECT, Insert, UPDATE, DELETE, CREATE, DROP, ALT, SET, REPLACE, EXECUTE.
- sql
Types string[] - SQL type. Supports simultaneous querying of multiple types. Currently supported: SELECT, Insert, UPDATE, DELETE, CREATE, DROP, ALT, SET, REPLACE, EXECUTE.
- sqls string[]
- SQL statement. Supports passing multiple SQL statements.
- table
Names string[] - Table name.
- thread
Ids string[] - Thread ID.
- users string[]
- User name.
- affect_
rows float - Affects the number of rows. Indicates that filtering affects audit logs with rows greater than this value.
- db_
names Sequence[str] - Database name.
- exec_
time float - Execution time. Unit: ms. Indicates audit logs with a filter execution time greater than this value.
- hosts Sequence[str]
- Client address.
- policy_
names Sequence[str] - Audit policy name.
- sent_
rows float - Returns the number of rows.
- sql str
- SQL statement. Supports fuzzy matching.
- sql_
type str - SQL type. Currently supported: SELECT, Insert, UPDATE, DELETE, CREATE, DROP, ALT, SET, REPLACE, EXECUTE.
- sql_
types Sequence[str] - SQL type. Supports simultaneous querying of multiple types. Currently supported: SELECT, Insert, UPDATE, DELETE, CREATE, DROP, ALT, SET, REPLACE, EXECUTE.
- sqls Sequence[str]
- SQL statement. Supports passing multiple SQL statements.
- table_
names Sequence[str] - Table name.
- thread_
ids Sequence[str] - Thread ID.
- users Sequence[str]
- User name.
- affect
Rows Number - Affects the number of rows. Indicates that filtering affects audit logs with rows greater than this value.
- db
Names List<String> - Database name.
- exec
Time Number - Execution time. Unit: ms. Indicates audit logs with a filter execution time greater than this value.
- hosts List<String>
- Client address.
- policy
Names List<String> - Audit policy name.
- sent
Rows Number - Returns the number of rows.
- sql String
- SQL statement. Supports fuzzy matching.
- sql
Type String - SQL type. Currently supported: SELECT, Insert, UPDATE, DELETE, CREATE, DROP, ALT, SET, REPLACE, EXECUTE.
- sql
Types List<String> - SQL type. Supports simultaneous querying of multiple types. Currently supported: SELECT, Insert, UPDATE, DELETE, CREATE, DROP, ALT, SET, REPLACE, EXECUTE.
- sqls List<String>
- SQL statement. Supports passing multiple SQL statements.
- table
Names List<String> - Table name.
- thread
Ids List<String> - Thread ID.
- users List<String>
- User name.
GetCynosdbAuditLogsItem
- Affect
Rows This property is required. double - Affects the number of rows.
- Db
Name This property is required. string - Database name.
- Err
Code This property is required. double - Error code.
- Exec
Time This property is required. double - Execution time.
- Host
This property is required. string - Client address.
- Instance
Name This property is required. string - Instance name.
- Policy
Name This property is required. string - Audit policy name.
- Sent
Rows This property is required. double - Number of rows sent.
- Sql
This property is required. string - SQL statement.
- Sql
Type This property is required. string - SQL type.
- Table
Name This property is required. string - Table name.
- Thread
Id This property is required. double - Execution thread ID.
- Timestamp
This property is required. string - Timestamp.
- User
This property is required. string - User name.
- Affect
Rows This property is required. float64 - Affects the number of rows.
- Db
Name This property is required. string - Database name.
- Err
Code This property is required. float64 - Error code.
- Exec
Time This property is required. float64 - Execution time.
- Host
This property is required. string - Client address.
- Instance
Name This property is required. string - Instance name.
- Policy
Name This property is required. string - Audit policy name.
- Sent
Rows This property is required. float64 - Number of rows sent.
- Sql
This property is required. string - SQL statement.
- Sql
Type This property is required. string - SQL type.
- Table
Name This property is required. string - Table name.
- Thread
Id This property is required. float64 - Execution thread ID.
- Timestamp
This property is required. string - Timestamp.
- User
This property is required. string - User name.
- affect
Rows This property is required. Double - Affects the number of rows.
- db
Name This property is required. String - Database name.
- err
Code This property is required. Double - Error code.
- exec
Time This property is required. Double - Execution time.
- host
This property is required. String - Client address.
- instance
Name This property is required. String - Instance name.
- policy
Name This property is required. String - Audit policy name.
- sent
Rows This property is required. Double - Number of rows sent.
- sql
This property is required. String - SQL statement.
- sql
Type This property is required. String - SQL type.
- table
Name This property is required. String - Table name.
- thread
Id This property is required. Double - Execution thread ID.
- timestamp
This property is required. String - Timestamp.
- user
This property is required. String - User name.
- affect
Rows This property is required. number - Affects the number of rows.
- db
Name This property is required. string - Database name.
- err
Code This property is required. number - Error code.
- exec
Time This property is required. number - Execution time.
- host
This property is required. string - Client address.
- instance
Name This property is required. string - Instance name.
- policy
Name This property is required. string - Audit policy name.
- sent
Rows This property is required. number - Number of rows sent.
- sql
This property is required. string - SQL statement.
- sql
Type This property is required. string - SQL type.
- table
Name This property is required. string - Table name.
- thread
Id This property is required. number - Execution thread ID.
- timestamp
This property is required. string - Timestamp.
- user
This property is required. string - User name.
- affect_
rows This property is required. float - Affects the number of rows.
- db_
name This property is required. str - Database name.
- err_
code This property is required. float - Error code.
- exec_
time This property is required. float - Execution time.
- host
This property is required. str - Client address.
- instance_
name This property is required. str - Instance name.
- policy_
name This property is required. str - Audit policy name.
- sent_
rows This property is required. float - Number of rows sent.
- sql
This property is required. str - SQL statement.
- sql_
type This property is required. str - SQL type.
- table_
name This property is required. str - Table name.
- thread_
id This property is required. float - Execution thread ID.
- timestamp
This property is required. str - Timestamp.
- user
This property is required. str - User name.
- affect
Rows This property is required. Number - Affects the number of rows.
- db
Name This property is required. String - Database name.
- err
Code This property is required. Number - Error code.
- exec
Time This property is required. Number - Execution time.
- host
This property is required. String - Client address.
- instance
Name This property is required. String - Instance name.
- policy
Name This property is required. String - Audit policy name.
- sent
Rows This property is required. Number - Number of rows sent.
- sql
This property is required. String - SQL statement.
- sql
Type This property is required. String - SQL type.
- table
Name This property is required. String - Table name.
- thread
Id This property is required. Number - Execution thread ID.
- timestamp
This property is required. String - Timestamp.
- user
This property is required. String - User name.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.
tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack