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 to be added is prepared.

Procedure for adding a Log Service SLS data source

  1. Log on to the DataV console.
  2. On the My Data tab, select Data Source and click Add Source.
  3. Select Log Service from the Type drop-down list.
  4. Enter Log Service information.
    Add a Log Service data source
    Parameter Description
    Name The 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 parameters 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 Log Service SLS 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.
    Notice If you have not created a visualization application on the My Visualization page, see Use a template to create a a project.
  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 widget.

  4. In the right-side configuration panel, click the Data tab and then Set.
    Configure a data source
  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 use JSON objects as query parameters. The query parameters that can be entered are:
    {
    "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, see Search syntax.
  8. Click Preview Data Response to view the returned data.