Highlight data in a table
After collecting NGINX access logs into Simple Log Service, you can apply table highlighting rules to color-code cells or rows based on field thresholds, such as marking failed requests in red.
Prerequisites
-
You have collected NGINX access logs. For more information, see Collect text logs from servers.
-
You have created indexes. For more information, see Create indexes.
Overview
In the Field/Column Settings panel, set the color scheme to Threshold for the status field and set Cell Display Mode to Background Highlight. For example, set a threshold of 400 so values of 400 or greater appear red and lower values appear green. With the query select request_method,status where status is not null, rows like GET/400 and POST/500 are highlighted red, while POST/200 rows are highlighted green.
-
Query and Analysis: Query and analyze logs to retrieve or aggregate data.
-
Add a chart: Add a table chart to a dashboard to display query results.
-
Configure highlighting: Highlight the text, background, or entire row in a table.
Step 1: Query and analyze
Log on to the Simple Log Service console. In the Projects section, click the project you want.

On the tab, click the logstore you want.

-
Enter a query statement, then click Last 15 Minutes to set the time range.
For example, to view request methods and status codes, run the following query:
* | SELECT request_method,status
Step 2: Add a chart
In the left-side navigation pane, choose . In the Dashboard list, click the dashboard you want. In the upper-right corner of the dashboard page, click Edit. In edit mode, choose .

-
In the section, select the
icon for Chart Type. On the Query and Analysis tab, select your data source (in this case, LogStore (SQL)), select the target Logstore, and enter a query statement.In the upper-right corner, select a time range such as Last 15 Minutes and click Apply.
Set Chart Type to Table. An example query:
* | select *.
Step 3: Configure highlighting
Highlight cell text
-
: Set the threshold-based color scheme.
-
: Apply text highlighting to the
statuscolumn in Query and Analysis A. -
: Set the
statusthreshold in Query and Analysis A to 400. Values wherestatus>=400appear red, and values wherestatus<400appear green.
Highlight cell background
-
: Set the threshold-based color scheme.
-
: Apply background highlighting to the
statuscolumn in Query and Analysis A. -
: Set the
statusthreshold in Query and Analysis A to 400. Values wherestatus>=400appear red, and values wherestatus<400appear green.
In the Field/Column Settings panel, set the color scheme to Threshold for the status field and set Cell Display Mode to Background Highlight. Set a threshold of 400: values of 400 or greater appear red, and lower values appear green. With the query select request_method,status where status is not null, rows like GET/400 and POST/500 are highlighted red, and POST/200 rows are highlighted green.
Highlight entire row
-
: Set the threshold-based color scheme.
-
: Apply full-row background highlighting based on the
statusfield in Query and Analysis A. -
: Set the
statusthreshold in Query and Analysis A to 400. Values wherestatus>=400appear red, and values wherestatus<400appear green.