- What's New
- Function Overview
- Service Overview
- Billing
- Getting Started
-
User Guide
- Granting LTS Permissions to IAM Users
- Purchasing LTS Resource Packages
- Log Management
-
Log Ingestion
- Overview
-
Using ICAgent to Collect Logs
- Overview
- Installing ICAgent (Intra-Region Hosts)
- Installing ICAgent (Extra-Region Hosts)
- Managing ICAgent
- Managing Host Groups
- Ingesting BMS Text Logs to LTS
- Ingesting CCE Application Logs to LTS
- Ingesting ECS Text Logs to LTS
- Ingesting ServiceStage Containerized Application Logs to LTS
- Ingesting ServiceStage Cloud Host Logs to LTS
- Ingesting Self-Built Kubernetes Application Logs to LTS
- Setting ICAgent Structuring Parsing Rules
-
Ingesting Cloud Service Logs to LTS
- Overview
- Ingesting AOM Logs to LTS
- Ingesting APIG Logs to LTS
- Ingesting CBH Logs to LTS
- Ingesting CFW Logs to LTS
- Ingesting CTS Logs to LTS
- Ingesting DDS Logs to LTS
- Ingesting DMS for Kafka Logs to LTS
- Ingesting DRS Logs to LTS
- Ingesting GaussDB(DWS) Logs to LTS
- Ingesting ELB Logs to LTS
- Ingesting Enterprise Router Logs to LTS
- Ingesting FunctionGraph Logs to LTS
- Ingesting GaussDB Logs to LTS
- Ingesting GES Logs to LTS
- Ingesting TaurusDB Logs to LTS
- Ingesting GeminiDB Logs to LTS
- Ingesting GeminiDB Mongo Logs to LTS
- Ingesting GeminiDB Cassandra Logs to LTS
- Ingesting IoTDA Logs to LTS
- Ingesting ModelArts Logs to LTS
- Ingesting MRS Logs to LTS
- Ingesting RDS for MySQL Logs to LTS
- Ingesting RDS for PostgreSQL Logs to LTS
- Ingesting RDS for SQL Server Logs to LTS
- Ingesting ROMA Connect Logs to LTS
- Ingesting SMN Logs to LTS
- Ingesting SecMaster Logs to LTS
- Ingesting OBS Files to LTS (Beta)
- Ingesting VPC Logs to LTS
- Ingesting WAF Logs to LTS
- Using APIs to Ingest Logs to LTS
- Ingesting Logs to LTS Across IAM Accounts
- Using Kafka to Report Logs to LTS
- Using Flume to Report Logs to LTS
- Log Search and Analysis
-
Log Visualization
- Overview
- Visualizing Logs in Statistical Charts
-
Visualizing Logs in Dashboards
- Creating a Dashboard
- Adding a Dashboard Filter
-
Dashboard Templates
- APIG Dashboard Templates
- CCE Dashboard Templates
- CDN Dashboard Templates
- CFW Dashboard Templates
- CSE Dashboard Templates
- DCS Dashboard Template
- DDS Dashboard Template
- DMS Dashboard Template
- DSL Dashboard Template
- ER Dashboard Template
- METRIC Dashboard Template
- Nginx Dashboard Templates
- VPC Dashboard Template
- WAF Dashboard Templates
- Log Alarms
- Log Transfer
- Log Processing
- Configuration Center
- Querying Real-Time LTS Traces
-
Best Practices
- Overview
-
Log Ingestion
- Collecting Logs from Third-Party Cloud Vendors, Internet Data Centers, and Other Huawei Cloud Regions to LTS
- Collecting Kubernetes Logs from Third-Party Clouds, IDCs, and Other Huawei Cloud Regions to LTS
- Collecting Syslog Aggregation Server Logs to LTS
- Importing Logs of Self-built ELK to LTS
- Using Flume to Report Logs to LTS
- Collecting Zabbix Data Through ECS Log Ingestion
- Collecting Logs from Multiple Channels to LTS
- Log Search and Analysis
- Log Transfer
- Billing
- Developer Guide
-
API Reference
- Before You Start
- API Overview
- Calling APIs
- API Calling Examples
- Examples
-
APIs
- Host Group Management
- Log Group Management
- Log Stream Management
- Log Management
- Log Ingestion
- Log Transfer
- Log Collection Beyond Free Quota
- Cloud Log Structuring
- Container Log Ingestion from AOM to LTS
- Alarm Topics
- Message Template Management
- SQL Alarm Rules
- Keyword Alarm Rules
- Alarm List
- Tag Management
- Dashboard Management
- Log Charts
- Quick Search
- Multi-Account Log Aggregation
- Permissions Policies and Supported Actions
- Appendix
- SDK Reference
-
FAQs
- Overview
- Consultation
- Log Management
-
Host Management
- What Do I Do If ICAgent Installation Fails in Windows and the Message "SERVICE STOP" Is Displayed?
- What Do I Do If ICAgent Upgrade Fails on the LTS Console?
- What Do I Do If I Could Not Query New Logs on LTS?
- What Do I Do If ICAgent Restarts Repeatedly After Being Installed?
- What Do I Do If ICAgent Is Displayed as Offline on the LTS Console After Installation?
- What Do I Do If I Do Not See a Host with ICAgent Installed on the LTS Console?
- How Do I Create a VPC Endpoint on the VPCEP Console?
- How Do I Obtain an AK/SK Pair?
- How Do I Install ICAgent by Creating an Agency?
-
Log Ingestion
- What Do I Do If LTS Cannot Collect Logs After I Configure Host Log Ingestion?
- Will LTS Stop Collecting Logs After the Free Quota Is Used Up If I Disable "Continue to Collect Logs When the Free Quota Is Exceeded" in AOM?
- What Do I Do If the CPU Usage Is High When ICAgent Is Collecting Logs?
- What Kinds of Logs and Files Does LTS Collect?
- How Do I Disable the Function of Collecting CCE Standard Output Logs to AOM on the LTS Console?
- What Log Rotation Scheme Should I Use for ICAgent to Collect Logs?
- Does LTS Use the Log4j Plug-in to Report Logs?
- How Long Does It Take to Generate Logs After Configuring Log Ingestion?
- What Do I Do If LTS Cannot Collect Logs After I Configure Log Ingestion with ICAgent?
- Log Search and Analysis
-
Log Transfer
- Does LTS Delete Logs That Have Been Transferred to OBS Buckets?
- What Are the Common Causes of LTS Log Transfer Abnormalities?
- How Do I Transfer CTS Logs to an OBS Bucket?
- What Do I Do If I Cannot View Historical Data in an OBS Bucket After Transferring Data from LTS to OBS?
- What Do I Do If I Cannot Find a New Partition in a DLI Table After Logs Are Transferred to DLI?
-
More Documents
- User Guide (ME-Abu Dhabi Region)
- API Reference (ME-Abu Dhabi Region)
- User Guide(Paris Regions)
- API Reference(Paris Regions)
- User Guide (Kuala Lumpur Region)
- API Reference (Kuala Lumpur Region)
- User Guide (Ankara Region)
-
API Reference (Ankara Region)
- Before You Start
- Calling APIs
- API Calling Examples
- APIs
- Permissions and Supported Actions
- Appendix
- Change History
- Videos
- General Reference
Copied.
String Functions
Description
SQL provides the string function for concatenating strings and converting between uppercase and lowercase letters. For details, see Table 1.
In the SQL syntax, characters must be enclosed in single quotation marks ('). Fields or table names are not enclosed or are enclosed with double quotation marks ("). For example, 'msg' indicates the character string msg, and msg or "msg" indicates the structured msg field.
Syntax
SELECT (fieldname1 || fieldname2) AS fieldname1_fieldname2
String Function Statements
Statement |
Description |
Example |
---|---|---|
CONCAT(expr1, expr2...) |
Concatenates all listed strings. |
SELECT str1, str2, str3, CONCAT(str1, str2, str3) WHERE str1 IS NOT NUll |
TEXTCAT(expr, expr) |
Concatenates two strings. |
SELECT str1, str2, TEXTCAT(str1, str2) WHERE str1 IS NOT NUll |
STRING_FORMAT(pattern[, args...]) |
Formats strings based on the Java string format. |
SELECT str1, STRING_FORMAT(str1, '%s') WHERE str1 IS NOT NUll |
LENGTH(expr) |
Returns the length of a string, which is the number of UTF-16 characters in the string. |
SELECT LENGTH(str1) WHERE str1 IS NOT NUll |
LOWER(expr) |
Converts a string into lowercase letters. |
SELECT LOWER(str1) WHERE str1 IS NOT NUll |
POSITION(string1 IN string2 [FROM fromIndex]) |
Returns the index of the position where string1 appears in string2 for the first time. The search starts from the specified index. If no index is specified, the search starts from index1. If string1 does not exist in string2, 0 is returned. |
SELECT POSITION(str1 IN str2 FROM 5) |
REGEXP_EXTRACT(expr, pattern, [index]) |
Extracts a string that matches a specified regular expression in expr. The index starts from 1. If no match is found, null is returned. If no index is specified or the index is 0, the first matched substring is returned. For exact match, add a caret (^) before the regular expression and a dollar sign ($) after the regular expression. |
SELECT REGEXP_EXTRACT(str1, '[A-Za-z]+://[A-Za-z0-9.-]+(/[^ ]*)', 5) |
REGEXP_LIKE(expr, pattern) |
Checks whether a string matches a specified regular expression. For exact match, add a caret (^) before the regular expression and a dollar sign ($) after the regular expression. The usage of this function is similar to that of the LIKE statement. The difference is that the LIKE statement searches for content with a specified pattern. |
SELECT REGEXP_LIKE(str1, '\.(jpg|jpeg|png|gif)$') |
REPLACE(expr, pattern, replacement) |
Uses replacement to replace the substring same as pattern in expr. |
SELECT REPLACE(expr,pattern, replacement) |
STRPOS(string1, string2) |
Returns the index of the position where string2 appears in string1 for the first time. The search starts from index1. If no result is found, 0 is returned. |
SELECT STRPOS(str1, str2) WHERE str1 IS NOT NUll AND str2 IS NOT NUll |
SUBSTRING(expr, index, [length]) |
Subtracts a string. length indicates how many UTF-16 characters will be extracted. |
SELECT SUBSTRING(str1, 3, 10) WHERE str1 IS NOT NUll |
RIGHT(expr, [length]) |
Truncates a specified length from the right to the left of a string. |
SELECT RIGHT(str1, 5) WHERE str1 IS NOT NUll |
LEFT(expr, [length]) |
Truncates a specified length from the left to the right of a string. |
SELECT LEFT(str1, 5) WHERE str1 IS NOT NUll |
SUBSTR(expr, index, [length]) |
Same as SUBSTRING. |
SELECT SUBSTR(str1, 3, 10) WHERE str1 IS NOT NUll |
UPPER(expr) |
Converts a string into uppercase letters. |
SELECT UPPER(str1) WHERE str1 IS NOT NUll |
REVERSE(expr) |
Reverses the character string. |
SELECT REVERSE(str1) WHERE str1 IS NOT NUll |
LPAD(expr, length, chars) |
Adds specified characters to the left of a string until the string reaches the specified length. If the specified length is less than the actual string length, the string is truncated based on the specified length. If the string or the specified character is null, null is returned. If the specified character is empty, no padding is performed. Characters may be deleted if necessary. |
SELECT LPAD(str1, 50, 'testStr') WHERE str1 IS NOT NUll |
RPAD(expr, length, chars) |
Adds specified characters to the right of a string until the string reaches the specified length. If the specified length is less than the actual string length, the string is truncated based on the specified length. If the string or the specified character is null, null is returned. If the specified character is empty, no padding is performed. Characters may be deleted if necessary. |
SELECT RPAD(str1, 50, 'testStr') WHERE str1 IS NOT NUll |
CONTAINS_STRING(<expr>, str) |
Checks whether expr contains the str string. |
SELECT CONTAINS_STRING(log_level,'warn') |
ICONTAINS_STRING(<expr>, str) |
Checks whether expr contains the str string. The string is not case sensitive. |
SELECT ICONTAINS_STRING(log_level,'WARN') |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot