This topic describes how to add a Log Service data source in DataV. Log Service (SLS) is a one-stop service for real-time data.

Prerequisites

The Log Service data source is prepared.

Procedure for adding a Log Service data source

  1. Log on to the DataV console.
  2. On the My Data tab, click Data Sources and click Add Data.
  3. Select Log Service from the Type drop-down list.
  4. Enter Log Service information.
    Add a Log Service data source
    ParameterFeature
    NameThe name of the data source you want to add. You can set this parameter to a custom name.
    AppKey The AccessKey ID of the account that has permissions to access the target Log Service instance.
    AppSecret The AccessKey secret of the account that has permissions to access the target Log Service instance.
    EndPoint Enter the endpoint of Log Service. For more information, see Log Service documentation. Set the parameter based on the network type and region of your SLS service.

    If your Log Service instance is deployed in a VPC in the China (Shanghai) region, enter https://cn-shanghai-intranet.log.aliyuncs.com in EndPoint.

  5. After you enter the information about the Tablestore data source, click OK.

    The added data source is displayed in the data source list.

Procedure for using a Log Service data source

  1. Log on to the DataV console.
  2. On the Projects tab, move the pointer over the project that you want to edit and click Edit.
    Important If you have not created a visualization application on the My Visualizations page, see Use a template to create a PC-side visual application to create a visualization application.
  3. In Canvas Editor, click a widget on the canvas.

    If no widget is added to the canvas, add a widget first. For more information, see Add a domain name.

  4. In the right-side configuration panel, click the Data tab and then Set.
    Configure data sources
  5. In the Set Data Source pane, select Log Service from the Data Source Type drop-down list.
  6. In the Select Data Source section, select the configured Log Service data source.
  7. Enter query parameters in the edit box under Query.
    You can query data by using a JSON object as a query parameter. The following query parameters are available:
    {
    "projectName": "test",
    "logStoreName": "access-log",
    "topic": "test",
    "from": 1509897600,
    "to": 1509984000,
    "query": "" ,
    "line": 100,
    "offset": 0
    }
    Note For more information about the query syntax for query parameters, seeSearch syntax.
  8. Click Preview Data Response to view the returned data.