Logtail supports three processing modes: native plug-in mode (implemented in C++, offering the highest performance), extended plug-in mode (implemented in Go, providing a rich and flexible ecosystem), and Structured Process Language (SPL) mode (introduced in Logtail 2.0, which combines performance with flexibility). By writing SPL statements, you can leverage SPL's robust computing power for data processing. This topic explains how to use SPL statements to achieve the same functionality as the other two processing modes.
Prerequisites
Simple Log Service is activated. For more information, see Activate Simple Log Service.
Limits
SPL is supported only for Logtail V2.0 and later.
The collection of text logs can be configured using the console, while the collection of the log types requires APIs or custom resource definitions (CRDs).
Procedure
Add SPL when modifying a Logtail configuration
Log on to the Simple Log Service console.
In the Projects section, click the project you want.
On the
tab, click the > icon next to the logstore you want, and then choose .In the Logtail Configuration list, find the required Logtail configuration and click Manage Logtail Configuration in the Actions column.
Click Edit. In the Processor Configurations section, set the Processing Method to SPL, and then click Save.
Add SPL when creating a Logtail configuration
Log on to the Simple Log Service console.
In the Quick Data Import section, click Import Data, and then click the Self-managed Open Source/Commercial Software tab. Select a card that contains the Text Logs suffix.
In the Select Logstore step, select a project and a logstore and click Next.
In the Machine Group Configurations step, configure a machine group.
Configure the Scenario and Installation Environment parameters based on your business requirements.
ImportantYou must configure the Scenario and Installation Environment parameters regardless of whether a machine group is available. The parameter settings affect subsequent configurations.
Make sure that a machine group is displayed in the Applied Server Groups section and click Next.
Machine group available
Select a machine group from the Source Machine Group section.
No machine group available
Click Create Machine Group. In the Create Machine Group panel, configure the parameters. You can set the Machine Group Identifier parameter to IP Address or Custom Identifier. For more information, see Create a custom identifier-based machine group or Create an IP address-based machine group.
ImportantIf you apply a machine group immediately after you create the machine group, the heartbeat status of the machine group may be FAIL. This issue occurs because the machine group is not connected to Simple Log Service. To resolve this issue, you can click Retry. If the issue persists, see What do I do if no heartbeat connections are detected on Logtail?
In the Logtail Configuration step, create a Logtail configuration and click Next.