When you create a trail and deliver events to Simple Log Service, ActionTrail automatically creates a Simple Log Service Logstore and configures indexes for the Logstore. If you manually delete or modify the indexes, the advanced event query and event alerting features may become unavailable. In this case, you must restore the index settings.
Restore the index settings in the ActionTrail console
If the advanced event query and event alerting features of ActionTrail are unavailable, you can perform the following steps to restore the index settings:
Log on to the ActionTrail console.
In the left-side navigation pane, click Trails.
On the Trails page, find the trail that you created, move the pointer over OSS or SLS & OSS in the Storage Service column, and then click the name of the Simple Log Service Logstore.
In the Simple Log Service console, choose on the page of the Logstore.
In the Search & Analysis panel, turn off LogReduce, turn on Full Text Index, and then turn on Enable Analytics for required fields in the
event
.Click OK.
In the Search & Analysis Settings message, click OK.
Restore the index settings by using Cloud Shell
If the advanced event query and event alerting features of ActionTrail are unavailable, you can use Cloud Shell to restore the index settings.
Log on to Cloud Shell.
Run the following command to restore the index settings:
actiontrail-update-index [project] [logstore] [regionId]
NoteReplace project, logstore, and regionId in the command with the actual values that are configured in Simple Log Service. project specifies the name of the Simple Log Service project, logstore specifies the name of the Simple Log Service Logstore, and regionId specifies the region where the Simple Log Service project resides. You can obtain the values on the trail details page in the ActionTrail console.
Sample code:
actiontrail-update-index actiontrail-ev**** actiontrail-test**** cn-hangzhou