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

tencentcloud.getMariadbSlowLogs

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 mariadb slow_logs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const slowLogs = tencentcloud.getMariadbSlowLogs({
        instanceId: "tdsql-9vqvls95",
        orderBy: "query_time_sum",
        orderByType: "desc",
        slave: 0,
        startTime: "2023-06-01 14:55:20",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    slow_logs = tencentcloud.get_mariadb_slow_logs(instance_id="tdsql-9vqvls95",
        order_by="query_time_sum",
        order_by_type="desc",
        slave=0,
        start_time="2023-06-01 14:55:20")
    
    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.GetMariadbSlowLogs(ctx, &tencentcloud.GetMariadbSlowLogsArgs{
    			InstanceId:  "tdsql-9vqvls95",
    			OrderBy:     pulumi.StringRef("query_time_sum"),
    			OrderByType: pulumi.StringRef("desc"),
    			Slave:       pulumi.Float64Ref(0),
    			StartTime:   "2023-06-01 14:55:20",
    		}, 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 slowLogs = Tencentcloud.GetMariadbSlowLogs.Invoke(new()
        {
            InstanceId = "tdsql-9vqvls95",
            OrderBy = "query_time_sum",
            OrderByType = "desc",
            Slave = 0,
            StartTime = "2023-06-01 14:55:20",
        });
    
    });
    
    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.GetMariadbSlowLogsArgs;
    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 slowLogs = TencentcloudFunctions.getMariadbSlowLogs(GetMariadbSlowLogsArgs.builder()
                .instanceId("tdsql-9vqvls95")
                .orderBy("query_time_sum")
                .orderByType("desc")
                .slave(0)
                .startTime("2023-06-01 14:55:20")
                .build());
    
        }
    }
    
    variables:
      slowLogs:
        fn::invoke:
          function: tencentcloud:getMariadbSlowLogs
          arguments:
            instanceId: tdsql-9vqvls95
            orderBy: query_time_sum
            orderByType: desc
            slave: 0
            startTime: 2023-06-01 14:55:20
    

    Using getMariadbSlowLogs

    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 getMariadbSlowLogs(args: GetMariadbSlowLogsArgs, opts?: InvokeOptions): Promise<GetMariadbSlowLogsResult>
    function getMariadbSlowLogsOutput(args: GetMariadbSlowLogsOutputArgs, opts?: InvokeOptions): Output<GetMariadbSlowLogsResult>
    def get_mariadb_slow_logs(db: Optional[str] = None,
                              end_time: Optional[str] = None,
                              id: Optional[str] = None,
                              instance_id: Optional[str] = None,
                              order_by: Optional[str] = None,
                              order_by_type: Optional[str] = None,
                              result_output_file: Optional[str] = None,
                              slave: Optional[float] = None,
                              start_time: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetMariadbSlowLogsResult
    def get_mariadb_slow_logs_output(db: Optional[pulumi.Input[str]] = None,
                              end_time: Optional[pulumi.Input[str]] = None,
                              id: Optional[pulumi.Input[str]] = None,
                              instance_id: Optional[pulumi.Input[str]] = None,
                              order_by: Optional[pulumi.Input[str]] = None,
                              order_by_type: Optional[pulumi.Input[str]] = None,
                              result_output_file: Optional[pulumi.Input[str]] = None,
                              slave: Optional[pulumi.Input[float]] = None,
                              start_time: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetMariadbSlowLogsResult]
    func GetMariadbSlowLogs(ctx *Context, args *GetMariadbSlowLogsArgs, opts ...InvokeOption) (*GetMariadbSlowLogsResult, error)
    func GetMariadbSlowLogsOutput(ctx *Context, args *GetMariadbSlowLogsOutputArgs, opts ...InvokeOption) GetMariadbSlowLogsResultOutput

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

    public static class GetMariadbSlowLogs 
    {
        public static Task<GetMariadbSlowLogsResult> InvokeAsync(GetMariadbSlowLogsArgs args, InvokeOptions? opts = null)
        public static Output<GetMariadbSlowLogsResult> Invoke(GetMariadbSlowLogsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetMariadbSlowLogsResult> getMariadbSlowLogs(GetMariadbSlowLogsArgs args, InvokeOptions options)
    public static Output<GetMariadbSlowLogsResult> getMariadbSlowLogs(GetMariadbSlowLogsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getMariadbSlowLogs:getMariadbSlowLogs
      arguments:
        # arguments dictionary

    The following arguments are supported:

    InstanceId string
    Instance ID in the format of tdsql-ow728lmc.
    StartTime string
    Query start time in the format of 2016-07-23 14:55:20.
    Db string
    Specific name of the database to be queried.
    EndTime string
    Query end time in the format of 2016-08-22 14:55:20.
    Id string
    OrderBy string
    Sorting metric. Valid values: query_time_sum, query_count.
    OrderByType string
    Sorting order. Valid values: desc, asc.
    ResultOutputFile string
    Used to save results.
    Slave double
    Query slow queries from either the primary or the replica. Valid values: 0 (primary), 1 (replica).
    InstanceId string
    Instance ID in the format of tdsql-ow728lmc.
    StartTime string
    Query start time in the format of 2016-07-23 14:55:20.
    Db string
    Specific name of the database to be queried.
    EndTime string
    Query end time in the format of 2016-08-22 14:55:20.
    Id string
    OrderBy string
    Sorting metric. Valid values: query_time_sum, query_count.
    OrderByType string
    Sorting order. Valid values: desc, asc.
    ResultOutputFile string
    Used to save results.
    Slave float64
    Query slow queries from either the primary or the replica. Valid values: 0 (primary), 1 (replica).
    instanceId String
    Instance ID in the format of tdsql-ow728lmc.
    startTime String
    Query start time in the format of 2016-07-23 14:55:20.
    db String
    Specific name of the database to be queried.
    endTime String
    Query end time in the format of 2016-08-22 14:55:20.
    id String
    orderBy String
    Sorting metric. Valid values: query_time_sum, query_count.
    orderByType String
    Sorting order. Valid values: desc, asc.
    resultOutputFile String
    Used to save results.
    slave Double
    Query slow queries from either the primary or the replica. Valid values: 0 (primary), 1 (replica).
    instanceId string
    Instance ID in the format of tdsql-ow728lmc.
    startTime string
    Query start time in the format of 2016-07-23 14:55:20.
    db string
    Specific name of the database to be queried.
    endTime string
    Query end time in the format of 2016-08-22 14:55:20.
    id string
    orderBy string
    Sorting metric. Valid values: query_time_sum, query_count.
    orderByType string
    Sorting order. Valid values: desc, asc.
    resultOutputFile string
    Used to save results.
    slave number
    Query slow queries from either the primary or the replica. Valid values: 0 (primary), 1 (replica).
    instance_id str
    Instance ID in the format of tdsql-ow728lmc.
    start_time str
    Query start time in the format of 2016-07-23 14:55:20.
    db str
    Specific name of the database to be queried.
    end_time str
    Query end time in the format of 2016-08-22 14:55:20.
    id str
    order_by str
    Sorting metric. Valid values: query_time_sum, query_count.
    order_by_type str
    Sorting order. Valid values: desc, asc.
    result_output_file str
    Used to save results.
    slave float
    Query slow queries from either the primary or the replica. Valid values: 0 (primary), 1 (replica).
    instanceId String
    Instance ID in the format of tdsql-ow728lmc.
    startTime String
    Query start time in the format of 2016-07-23 14:55:20.
    db String
    Specific name of the database to be queried.
    endTime String
    Query end time in the format of 2016-08-22 14:55:20.
    id String
    orderBy String
    Sorting metric. Valid values: query_time_sum, query_count.
    orderByType String
    Sorting order. Valid values: desc, asc.
    resultOutputFile String
    Used to save results.
    slave Number
    Query slow queries from either the primary or the replica. Valid values: 0 (primary), 1 (replica).

    getMariadbSlowLogs Result

    The following output properties are available:

    Datas List<GetMariadbSlowLogsData>
    Slow query log data.
    Id string
    InstanceId string
    LockTimeSum double
    Total statement lock time.
    QueryCount double
    Total number of statement queries.
    QueryTimeSum double
    Total statement query time.
    StartTime string
    Db string
    Database name.
    EndTime string
    OrderBy string
    OrderByType string
    ResultOutputFile string
    Slave double
    Datas []GetMariadbSlowLogsData
    Slow query log data.
    Id string
    InstanceId string
    LockTimeSum float64
    Total statement lock time.
    QueryCount float64
    Total number of statement queries.
    QueryTimeSum float64
    Total statement query time.
    StartTime string
    Db string
    Database name.
    EndTime string
    OrderBy string
    OrderByType string
    ResultOutputFile string
    Slave float64
    datas List<GetMariadbSlowLogsData>
    Slow query log data.
    id String
    instanceId String
    lockTimeSum Double
    Total statement lock time.
    queryCount Double
    Total number of statement queries.
    queryTimeSum Double
    Total statement query time.
    startTime String
    db String
    Database name.
    endTime String
    orderBy String
    orderByType String
    resultOutputFile String
    slave Double
    datas GetMariadbSlowLogsData[]
    Slow query log data.
    id string
    instanceId string
    lockTimeSum number
    Total statement lock time.
    queryCount number
    Total number of statement queries.
    queryTimeSum number
    Total statement query time.
    startTime string
    db string
    Database name.
    endTime string
    orderBy string
    orderByType string
    resultOutputFile string
    slave number
    datas Sequence[GetMariadbSlowLogsData]
    Slow query log data.
    id str
    instance_id str
    lock_time_sum float
    Total statement lock time.
    query_count float
    Total number of statement queries.
    query_time_sum float
    Total statement query time.
    start_time str
    db str
    Database name.
    end_time str
    order_by str
    order_by_type str
    result_output_file str
    slave float
    datas List<Property Map>
    Slow query log data.
    id String
    instanceId String
    lockTimeSum Number
    Total statement lock time.
    queryCount Number
    Total number of statement queries.
    queryTimeSum Number
    Total statement query time.
    startTime String
    db String
    Database name.
    endTime String
    orderBy String
    orderByType String
    resultOutputFile String
    slave Number

    Supporting Types

    GetMariadbSlowLogsData

    CheckSum string
    Statement checksum for querying details.
    Db string
    Specific name of the database to be queried.
    ExampleSql string
    Sample SQLNote: This field may return null, indicating that no valid values can be obtained.
    FingerPrint string
    Abstracted SQL statement.
    Host string
    Host address of account.
    LockTimeAvg string
    Average lock time.
    LockTimeMax string
    Maximum lock time.
    LockTimeMin string
    Minimum lock time.
    LockTimeSum string
    Total statement lock time.
    QueryCount string
    Total number of statement queries.
    QueryTimeAvg string
    Average query time.
    QueryTimeMax string
    Maximum query time.
    QueryTimeMin string
    Minimum query time.
    QueryTimeSum string
    Total statement query time.
    RowsExaminedSum string
    Number of scanned rows.
    RowsSentSum string
    Number of sent rows.
    TsMax string
    Last execution time.
    TsMin string
    First execution time.
    User string
    Account.
    CheckSum string
    Statement checksum for querying details.
    Db string
    Specific name of the database to be queried.
    ExampleSql string
    Sample SQLNote: This field may return null, indicating that no valid values can be obtained.
    FingerPrint string
    Abstracted SQL statement.
    Host string
    Host address of account.
    LockTimeAvg string
    Average lock time.
    LockTimeMax string
    Maximum lock time.
    LockTimeMin string
    Minimum lock time.
    LockTimeSum string
    Total statement lock time.
    QueryCount string
    Total number of statement queries.
    QueryTimeAvg string
    Average query time.
    QueryTimeMax string
    Maximum query time.
    QueryTimeMin string
    Minimum query time.
    QueryTimeSum string
    Total statement query time.
    RowsExaminedSum string
    Number of scanned rows.
    RowsSentSum string
    Number of sent rows.
    TsMax string
    Last execution time.
    TsMin string
    First execution time.
    User string
    Account.
    checkSum String
    Statement checksum for querying details.
    db String
    Specific name of the database to be queried.
    exampleSql String
    Sample SQLNote: This field may return null, indicating that no valid values can be obtained.
    fingerPrint String
    Abstracted SQL statement.
    host String
    Host address of account.
    lockTimeAvg String
    Average lock time.
    lockTimeMax String
    Maximum lock time.
    lockTimeMin String
    Minimum lock time.
    lockTimeSum String
    Total statement lock time.
    queryCount String
    Total number of statement queries.
    queryTimeAvg String
    Average query time.
    queryTimeMax String
    Maximum query time.
    queryTimeMin String
    Minimum query time.
    queryTimeSum String
    Total statement query time.
    rowsExaminedSum String
    Number of scanned rows.
    rowsSentSum String
    Number of sent rows.
    tsMax String
    Last execution time.
    tsMin String
    First execution time.
    user String
    Account.
    checkSum string
    Statement checksum for querying details.
    db string
    Specific name of the database to be queried.
    exampleSql string
    Sample SQLNote: This field may return null, indicating that no valid values can be obtained.
    fingerPrint string
    Abstracted SQL statement.
    host string
    Host address of account.
    lockTimeAvg string
    Average lock time.
    lockTimeMax string
    Maximum lock time.
    lockTimeMin string
    Minimum lock time.
    lockTimeSum string
    Total statement lock time.
    queryCount string
    Total number of statement queries.
    queryTimeAvg string
    Average query time.
    queryTimeMax string
    Maximum query time.
    queryTimeMin string
    Minimum query time.
    queryTimeSum string
    Total statement query time.
    rowsExaminedSum string
    Number of scanned rows.
    rowsSentSum string
    Number of sent rows.
    tsMax string
    Last execution time.
    tsMin string
    First execution time.
    user string
    Account.
    check_sum str
    Statement checksum for querying details.
    db str
    Specific name of the database to be queried.
    example_sql str
    Sample SQLNote: This field may return null, indicating that no valid values can be obtained.
    finger_print str
    Abstracted SQL statement.
    host str
    Host address of account.
    lock_time_avg str
    Average lock time.
    lock_time_max str
    Maximum lock time.
    lock_time_min str
    Minimum lock time.
    lock_time_sum str
    Total statement lock time.
    query_count str
    Total number of statement queries.
    query_time_avg str
    Average query time.
    query_time_max str
    Maximum query time.
    query_time_min str
    Minimum query time.
    query_time_sum str
    Total statement query time.
    rows_examined_sum str
    Number of scanned rows.
    rows_sent_sum str
    Number of sent rows.
    ts_max str
    Last execution time.
    ts_min str
    First execution time.
    user str
    Account.
    checkSum String
    Statement checksum for querying details.
    db String
    Specific name of the database to be queried.
    exampleSql String
    Sample SQLNote: This field may return null, indicating that no valid values can be obtained.
    fingerPrint String
    Abstracted SQL statement.
    host String
    Host address of account.
    lockTimeAvg String
    Average lock time.
    lockTimeMax String
    Maximum lock time.
    lockTimeMin String
    Minimum lock time.
    lockTimeSum String
    Total statement lock time.
    queryCount String
    Total number of statement queries.
    queryTimeAvg String
    Average query time.
    queryTimeMax String
    Maximum query time.
    queryTimeMin String
    Minimum query time.
    queryTimeSum String
    Total statement query time.
    rowsExaminedSum String
    Number of scanned rows.
    rowsSentSum String
    Number of sent rows.
    tsMax String
    Last execution time.
    tsMin String
    First execution time.
    user String
    Account.

    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