1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getMysqlSlowLogData
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.getMysqlSlowLogData

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Use this data source to query detailed information of mysql slow_log_data

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const slowLogData = tencentcloud.getMysqlSlowLogData({
        dataBases: ["tf_ci_test"],
        endTime: 1684392459,
        instType: "slave",
        instanceId: "cdb-fitq5t9h",
        orderBy: "ASC",
        sortBy: "Timestamp",
        startTime: 1682664459,
        userHosts: ["169.254.128.158"],
        userNames: ["keep_dts"],
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    slow_log_data = tencentcloud.get_mysql_slow_log_data(data_bases=["tf_ci_test"],
        end_time=1684392459,
        inst_type="slave",
        instance_id="cdb-fitq5t9h",
        order_by="ASC",
        sort_by="Timestamp",
        start_time=1682664459,
        user_hosts=["169.254.128.158"],
        user_names=["keep_dts"])
    
    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.GetMysqlSlowLogData(ctx, &tencentcloud.GetMysqlSlowLogDataArgs{
    			DataBases: []string{
    				"tf_ci_test",
    			},
    			EndTime:    1684392459,
    			InstType:   pulumi.StringRef("slave"),
    			InstanceId: "cdb-fitq5t9h",
    			OrderBy:    pulumi.StringRef("ASC"),
    			SortBy:     pulumi.StringRef("Timestamp"),
    			StartTime:  1682664459,
    			UserHosts: []string{
    				"169.254.128.158",
    			},
    			UserNames: []string{
    				"keep_dts",
    			},
    		}, 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 slowLogData = Tencentcloud.GetMysqlSlowLogData.Invoke(new()
        {
            DataBases = new[]
            {
                "tf_ci_test",
            },
            EndTime = 1684392459,
            InstType = "slave",
            InstanceId = "cdb-fitq5t9h",
            OrderBy = "ASC",
            SortBy = "Timestamp",
            StartTime = 1682664459,
            UserHosts = new[]
            {
                "169.254.128.158",
            },
            UserNames = new[]
            {
                "keep_dts",
            },
        });
    
    });
    
    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.GetMysqlSlowLogDataArgs;
    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 slowLogData = TencentcloudFunctions.getMysqlSlowLogData(GetMysqlSlowLogDataArgs.builder()
                .dataBases("tf_ci_test")
                .endTime(1684392459)
                .instType("slave")
                .instanceId("cdb-fitq5t9h")
                .orderBy("ASC")
                .sortBy("Timestamp")
                .startTime(1682664459)
                .userHosts("169.254.128.158")
                .userNames("keep_dts")
                .build());
    
        }
    }
    
    variables:
      slowLogData:
        fn::invoke:
          function: tencentcloud:getMysqlSlowLogData
          arguments:
            dataBases:
              - tf_ci_test
            endTime: 1.684392459e+09
            instType: slave
            instanceId: cdb-fitq5t9h
            orderBy: ASC
            sortBy: Timestamp
            startTime: 1.682664459e+09
            userHosts:
              - 169.254.128.158
            userNames:
              - keep_dts
    

    Using getMysqlSlowLogData

    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 getMysqlSlowLogData(args: GetMysqlSlowLogDataArgs, opts?: InvokeOptions): Promise<GetMysqlSlowLogDataResult>
    function getMysqlSlowLogDataOutput(args: GetMysqlSlowLogDataOutputArgs, opts?: InvokeOptions): Output<GetMysqlSlowLogDataResult>
    def get_mysql_slow_log_data(data_bases: Optional[Sequence[str]] = None,
                                end_time: Optional[float] = None,
                                id: Optional[str] = None,
                                inst_type: Optional[str] = None,
                                instance_id: Optional[str] = None,
                                order_by: Optional[str] = None,
                                result_output_file: Optional[str] = None,
                                sort_by: Optional[str] = None,
                                start_time: Optional[float] = None,
                                user_hosts: Optional[Sequence[str]] = None,
                                user_names: Optional[Sequence[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> GetMysqlSlowLogDataResult
    def get_mysql_slow_log_data_output(data_bases: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                end_time: Optional[pulumi.Input[float]] = None,
                                id: Optional[pulumi.Input[str]] = None,
                                inst_type: Optional[pulumi.Input[str]] = None,
                                instance_id: Optional[pulumi.Input[str]] = None,
                                order_by: Optional[pulumi.Input[str]] = None,
                                result_output_file: Optional[pulumi.Input[str]] = None,
                                sort_by: Optional[pulumi.Input[str]] = None,
                                start_time: Optional[pulumi.Input[float]] = None,
                                user_hosts: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                user_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetMysqlSlowLogDataResult]
    func GetMysqlSlowLogData(ctx *Context, args *GetMysqlSlowLogDataArgs, opts ...InvokeOption) (*GetMysqlSlowLogDataResult, error)
    func GetMysqlSlowLogDataOutput(ctx *Context, args *GetMysqlSlowLogDataOutputArgs, opts ...InvokeOption) GetMysqlSlowLogDataResultOutput

    > Note: This function is named GetMysqlSlowLogData in the Go SDK.

    public static class GetMysqlSlowLogData 
    {
        public static Task<GetMysqlSlowLogDataResult> InvokeAsync(GetMysqlSlowLogDataArgs args, InvokeOptions? opts = null)
        public static Output<GetMysqlSlowLogDataResult> Invoke(GetMysqlSlowLogDataInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetMysqlSlowLogDataResult> getMysqlSlowLogData(GetMysqlSlowLogDataArgs args, InvokeOptions options)
    public static Output<GetMysqlSlowLogDataResult> getMysqlSlowLogData(GetMysqlSlowLogDataArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getMysqlSlowLogData:getMysqlSlowLogData
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EndTime double
    End timestamp. For example 1585142640.
    InstanceId string
    instance id.
    StartTime double
    Start timestamp. For example 1585142640.
    DataBases List<string>
    List of databases accessed.
    Id string
    InstType string
    Only valid when the instance is the master instance or disaster recovery instance, the optional value: slave, which means to pull the log of the slave machine.
    OrderBy string
    Sort in ascending or descending order. Currently supported: ASC,DESC.
    ResultOutputFile string
    Used to save results.
    SortBy string
    Sort field. Currently supported: Timestamp, QueryTime, LockTime, RowsExamined, RowsSent.
    UserHosts List<string>
    List of client hosts.
    UserNames List<string>
    A list of client usernames.
    EndTime float64
    End timestamp. For example 1585142640.
    InstanceId string
    instance id.
    StartTime float64
    Start timestamp. For example 1585142640.
    DataBases []string
    List of databases accessed.
    Id string
    InstType string
    Only valid when the instance is the master instance or disaster recovery instance, the optional value: slave, which means to pull the log of the slave machine.
    OrderBy string
    Sort in ascending or descending order. Currently supported: ASC,DESC.
    ResultOutputFile string
    Used to save results.
    SortBy string
    Sort field. Currently supported: Timestamp, QueryTime, LockTime, RowsExamined, RowsSent.
    UserHosts []string
    List of client hosts.
    UserNames []string
    A list of client usernames.
    endTime Double
    End timestamp. For example 1585142640.
    instanceId String
    instance id.
    startTime Double
    Start timestamp. For example 1585142640.
    dataBases List<String>
    List of databases accessed.
    id String
    instType String
    Only valid when the instance is the master instance or disaster recovery instance, the optional value: slave, which means to pull the log of the slave machine.
    orderBy String
    Sort in ascending or descending order. Currently supported: ASC,DESC.
    resultOutputFile String
    Used to save results.
    sortBy String
    Sort field. Currently supported: Timestamp, QueryTime, LockTime, RowsExamined, RowsSent.
    userHosts List<String>
    List of client hosts.
    userNames List<String>
    A list of client usernames.
    endTime number
    End timestamp. For example 1585142640.
    instanceId string
    instance id.
    startTime number
    Start timestamp. For example 1585142640.
    dataBases string[]
    List of databases accessed.
    id string
    instType string
    Only valid when the instance is the master instance or disaster recovery instance, the optional value: slave, which means to pull the log of the slave machine.
    orderBy string
    Sort in ascending or descending order. Currently supported: ASC,DESC.
    resultOutputFile string
    Used to save results.
    sortBy string
    Sort field. Currently supported: Timestamp, QueryTime, LockTime, RowsExamined, RowsSent.
    userHosts string[]
    List of client hosts.
    userNames string[]
    A list of client usernames.
    end_time float
    End timestamp. For example 1585142640.
    instance_id str
    instance id.
    start_time float
    Start timestamp. For example 1585142640.
    data_bases Sequence[str]
    List of databases accessed.
    id str
    inst_type str
    Only valid when the instance is the master instance or disaster recovery instance, the optional value: slave, which means to pull the log of the slave machine.
    order_by str
    Sort in ascending or descending order. Currently supported: ASC,DESC.
    result_output_file str
    Used to save results.
    sort_by str
    Sort field. Currently supported: Timestamp, QueryTime, LockTime, RowsExamined, RowsSent.
    user_hosts Sequence[str]
    List of client hosts.
    user_names Sequence[str]
    A list of client usernames.
    endTime Number
    End timestamp. For example 1585142640.
    instanceId String
    instance id.
    startTime Number
    Start timestamp. For example 1585142640.
    dataBases List<String>
    List of databases accessed.
    id String
    instType String
    Only valid when the instance is the master instance or disaster recovery instance, the optional value: slave, which means to pull the log of the slave machine.
    orderBy String
    Sort in ascending or descending order. Currently supported: ASC,DESC.
    resultOutputFile String
    Used to save results.
    sortBy String
    Sort field. Currently supported: Timestamp, QueryTime, LockTime, RowsExamined, RowsSent.
    userHosts List<String>
    List of client hosts.
    userNames List<String>
    A list of client usernames.

    getMysqlSlowLogData Result

    The following output properties are available:

    EndTime double
    Id string
    InstanceId string
    Items List<GetMysqlSlowLogDataItem>
    Query records.
    StartTime double
    DataBases List<string>
    InstType string
    OrderBy string
    ResultOutputFile string
    SortBy string
    UserHosts List<string>
    UserNames List<string>
    EndTime float64
    Id string
    InstanceId string
    Items []GetMysqlSlowLogDataItem
    Query records.
    StartTime float64
    DataBases []string
    InstType string
    OrderBy string
    ResultOutputFile string
    SortBy string
    UserHosts []string
    UserNames []string
    endTime Double
    id String
    instanceId String
    items List<GetMysqlSlowLogDataItem>
    Query records.
    startTime Double
    dataBases List<String>
    instType String
    orderBy String
    resultOutputFile String
    sortBy String
    userHosts List<String>
    userNames List<String>
    endTime number
    id string
    instanceId string
    items GetMysqlSlowLogDataItem[]
    Query records.
    startTime number
    dataBases string[]
    instType string
    orderBy string
    resultOutputFile string
    sortBy string
    userHosts string[]
    userNames string[]
    endTime Number
    id String
    instanceId String
    items List<Property Map>
    Query records.
    startTime Number
    dataBases List<String>
    instType String
    orderBy String
    resultOutputFile String
    sortBy String
    userHosts List<String>
    userNames List<String>

    Supporting Types

    GetMysqlSlowLogDataItem

    Database string
    database name.
    LockTime double
    Lock duration (seconds).
    Md5 string
    The md5 of the Sql statement.
    QueryTime double
    Sql execution time (seconds).
    RowsExamined double
    The number of rows to scan.
    RowsSent double
    The number of rows in the result set.
    SqlTemplate string
    Sql template.
    SqlText string
    Sql statement.
    Timestamp double
    Sql execution time.
    UserHost string
    client address.
    UserName string
    user name.
    Database string
    database name.
    LockTime float64
    Lock duration (seconds).
    Md5 string
    The md5 of the Sql statement.
    QueryTime float64
    Sql execution time (seconds).
    RowsExamined float64
    The number of rows to scan.
    RowsSent float64
    The number of rows in the result set.
    SqlTemplate string
    Sql template.
    SqlText string
    Sql statement.
    Timestamp float64
    Sql execution time.
    UserHost string
    client address.
    UserName string
    user name.
    database String
    database name.
    lockTime Double
    Lock duration (seconds).
    md5 String
    The md5 of the Sql statement.
    queryTime Double
    Sql execution time (seconds).
    rowsExamined Double
    The number of rows to scan.
    rowsSent Double
    The number of rows in the result set.
    sqlTemplate String
    Sql template.
    sqlText String
    Sql statement.
    timestamp Double
    Sql execution time.
    userHost String
    client address.
    userName String
    user name.
    database string
    database name.
    lockTime number
    Lock duration (seconds).
    md5 string
    The md5 of the Sql statement.
    queryTime number
    Sql execution time (seconds).
    rowsExamined number
    The number of rows to scan.
    rowsSent number
    The number of rows in the result set.
    sqlTemplate string
    Sql template.
    sqlText string
    Sql statement.
    timestamp number
    Sql execution time.
    userHost string
    client address.
    userName string
    user name.
    database str
    database name.
    lock_time float
    Lock duration (seconds).
    md5 str
    The md5 of the Sql statement.
    query_time float
    Sql execution time (seconds).
    rows_examined float
    The number of rows to scan.
    rows_sent float
    The number of rows in the result set.
    sql_template str
    Sql template.
    sql_text str
    Sql statement.
    timestamp float
    Sql execution time.
    user_host str
    client address.
    user_name str
    user name.
    database String
    database name.
    lockTime Number
    Lock duration (seconds).
    md5 String
    The md5 of the Sql statement.
    queryTime Number
    Sql execution time (seconds).
    rowsExamined Number
    The number of rows to scan.
    rowsSent Number
    The number of rows in the result set.
    sqlTemplate String
    Sql template.
    sqlText String
    Sql statement.
    timestamp Number
    Sql execution time.
    userHost String
    client address.
    userName String
    user name.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack