tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack
tencentcloud.getCynosdbAuditLogs
Explore with Pulumi AI
tencentcloud 1.81.189 published on Wednesday, Apr 30, 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 string - The end time is in the format of 2017-07-12 10:29:20.
- Instance
Id string - Instance ID.
- Start
Time 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 string - The end time is in the format of 2017-07-12 10:29:20.
- Instance
Id string - Instance ID.
- Start
Time 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 String - The end time is in the format of 2017-07-12 10:29:20.
- instance
Id String - Instance ID.
- start
Time 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 string - The end time is in the format of 2017-07-12 10:29:20.
- instance
Id string - Instance ID.
- start
Time 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 str - The end time is in the format of 2017-07-12 10:29:20.
- instance_
id str - Instance ID.
- start_
time 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 String - The end time is in the format of 2017-07-12 10:29:20.
- instance
Id String - Instance ID.
- start
Time 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 double - Affects the number of rows.
- Db
Name string - Database name.
- Err
Code double - Error code.
- Exec
Time double - Execution time.
- Host string
- Client address.
- Instance
Name string - Instance name.
- Policy
Name string - Audit policy name.
- Sent
Rows double - Number of rows sent.
- Sql string
- SQL statement.
- Sql
Type string - SQL type.
- Table
Name string - Table name.
- Thread
Id double - Execution thread ID.
- Timestamp string
- Timestamp.
- User string
- User name.
- Affect
Rows float64 - Affects the number of rows.
- Db
Name string - Database name.
- Err
Code float64 - Error code.
- Exec
Time float64 - Execution time.
- Host string
- Client address.
- Instance
Name string - Instance name.
- Policy
Name string - Audit policy name.
- Sent
Rows float64 - Number of rows sent.
- Sql string
- SQL statement.
- Sql
Type string - SQL type.
- Table
Name string - Table name.
- Thread
Id float64 - Execution thread ID.
- Timestamp string
- Timestamp.
- User string
- User name.
- affect
Rows Double - Affects the number of rows.
- db
Name String - Database name.
- err
Code Double - Error code.
- exec
Time Double - Execution time.
- host String
- Client address.
- instance
Name String - Instance name.
- policy
Name String - Audit policy name.
- sent
Rows Double - Number of rows sent.
- sql String
- SQL statement.
- sql
Type String - SQL type.
- table
Name String - Table name.
- thread
Id Double - Execution thread ID.
- timestamp String
- Timestamp.
- user String
- User name.
- affect
Rows number - Affects the number of rows.
- db
Name string - Database name.
- err
Code number - Error code.
- exec
Time number - Execution time.
- host string
- Client address.
- instance
Name string - Instance name.
- policy
Name string - Audit policy name.
- sent
Rows number - Number of rows sent.
- sql string
- SQL statement.
- sql
Type string - SQL type.
- table
Name string - Table name.
- thread
Id number - Execution thread ID.
- timestamp string
- Timestamp.
- user string
- User name.
- affect_
rows float - Affects the number of rows.
- db_
name str - Database name.
- err_
code float - Error code.
- exec_
time float - Execution time.
- host str
- Client address.
- instance_
name str - Instance name.
- policy_
name str - Audit policy name.
- sent_
rows float - Number of rows sent.
- sql str
- SQL statement.
- sql_
type str - SQL type.
- table_
name str - Table name.
- thread_
id float - Execution thread ID.
- timestamp str
- Timestamp.
- user str
- User name.
- affect
Rows Number - Affects the number of rows.
- db
Name String - Database name.
- err
Code Number - Error code.
- exec
Time Number - Execution time.
- host String
- Client address.
- instance
Name String - Instance name.
- policy
Name String - Audit policy name.
- sent
Rows Number - Number of rows sent.
- sql String
- SQL statement.
- sql
Type String - SQL type.
- table
Name String - Table name.
- thread
Id Number - Execution thread ID.
- timestamp String
- Timestamp.
- user 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.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack