StoreIndexArgs

data class StoreIndexArgs(val fieldSearches: Output<List<StoreIndexFieldSearchArgs>>? = null, val fullText: Output<StoreIndexFullTextArgs>? = null, val logstore: Output<String>? = null, val project: Output<String>? = null) : ConvertibleToJava<StoreIndexArgs>

Log Service provides the LogSearch/Analytics function to query and analyze large amounts of logs in real time. You can use this function by enabling the index and field statistics. Refer to details

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as random from "@pulumi/random";
const _default = new random.index.Integer("default", {
max: 99999,
min: 10000,
});
const example = new alicloud.log.Project("example", {
projectName: `terraform-example-${_default.result}`,
description: "terraform-example",
});
const exampleStore = new alicloud.log.Store("example", {
projectName: example.projectName,
logstoreName: "example-store",
shardCount: 3,
autoSplit: true,
maxSplitShardCount: 60,
appendMeta: true,
});
const exampleStoreIndex = new alicloud.log.StoreIndex("example", {
project: example.projectName,
logstore: exampleStore.logstoreName,
fullText: {
caseSensitive: true,
token: ` #^*\x0d
\x09`,
},
fieldSearches: [{
name: "terraform-example",
enableAnalytics: true,
type: "text",
token: ` #^*\x0d
\x09`,
}],
});
import pulumi
import pulumi_alicloud as alicloud
import pulumi_random as random
default = random.index.Integer("default",
max=99999,
min=10000)
example = alicloud.log.Project("example",
project_name=f"terraform-example-{default['result']}",
description="terraform-example")
example_store = alicloud.log.Store("example",
project_name=example.project_name,
logstore_name="example-store",
shard_count=3,
auto_split=True,
max_split_shard_count=60,
append_meta=True)
example_store_index = alicloud.log.StoreIndex("example",
project=example.project_name,
logstore=example_store.logstore_name,
full_text={
"case_sensitive": True,
"token": """ #$^*\x0d
\x09""",
},
field_searches=[{
"name": "terraform-example",
"enable_analytics": True,
"type": "text",
"token": """ #$^*\x0d
\x09""",
}])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var @default = new Random.Index.Integer("default", new()
{
Max = 99999,
Min = 10000,
});
var example = new AliCloud.Log.Project("example", new()
{
ProjectName = $"terraform-example-{@default.Result}",
Description = "terraform-example",
});
var exampleStore = new AliCloud.Log.Store("example", new()
{
ProjectName = example.ProjectName,
LogstoreName = "example-store",
ShardCount = 3,
AutoSplit = true,
MaxSplitShardCount = 60,
AppendMeta = true,
});
var exampleStoreIndex = new AliCloud.Log.StoreIndex("example", new()
{
Project = example.ProjectName,
Logstore = exampleStore.LogstoreName,
FullText = new AliCloud.Log.Inputs.StoreIndexFullTextArgs
{
CaseSensitive = true,
Token = @" #$^*
",
},
FieldSearches = new[]
{
new AliCloud.Log.Inputs.StoreIndexFieldSearchArgs
{
Name = "terraform-example",
EnableAnalytics = true,
Type = "text",
Token = @" #$^*
",
},
},
});
});
 package main
import (
"fmt"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
Max: 99999,
Min: 10000,
})
if err != nil {
return err
}
example, err := log.NewProject(ctx, "example", &log.ProjectArgs{
ProjectName: pulumi.Sprintf("terraform-example-%v", _default.Result),
Description: pulumi.String("terraform-example"),
})
if err != nil {
return err
}
exampleStore, err := log.NewStore(ctx, "example", &log.StoreArgs{
ProjectName: example.ProjectName,
LogstoreName: pulumi.String("example-store"),
ShardCount: pulumi.Int(3),
AutoSplit: pulumi.Bool(true),
MaxSplitShardCount: pulumi.Int(60),
AppendMeta: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = log.NewStoreIndex(ctx, "example", &log.StoreIndexArgs{
Project: example.ProjectName,
Logstore: exampleStore.LogstoreName,
FullText: &log.StoreIndexFullTextArgs{
CaseSensitive: pulumi.Bool(true),
Token: pulumi.String(" #$^*
\n "),
},
FieldSearches: log.StoreIndexFieldSearchArray{
&log.StoreIndexFieldSearchArgs{
Name: pulumi.String("terraform-example"),
EnableAnalytics: pulumi.Bool(true),
Type: pulumi.String("text"),
Token: pulumi.String(" #$^*
\n "),
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.integer;
import com.pulumi.random.integerArgs;
import com.pulumi.alicloud.log.Project;
import com.pulumi.alicloud.log.ProjectArgs;
import com.pulumi.alicloud.log.Store;
import com.pulumi.alicloud.log.StoreArgs;
import com.pulumi.alicloud.log.StoreIndex;
import com.pulumi.alicloud.log.StoreIndexArgs;
import com.pulumi.alicloud.log.inputs.StoreIndexFullTextArgs;
import com.pulumi.alicloud.log.inputs.StoreIndexFieldSearchArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var default_ = new Integer("default", IntegerArgs.builder()
.max(99999)
.min(10000)
.build());
var example = new Project("example", ProjectArgs.builder()
.projectName(String.format("terraform-example-%s", default_.result()))
.description("terraform-example")
.build());
var exampleStore = new Store("exampleStore", StoreArgs.builder()
.projectName(example.projectName())
.logstoreName("example-store")
.shardCount(3)
.autoSplit(true)
.maxSplitShardCount(60)
.appendMeta(true)
.build());
var exampleStoreIndex = new StoreIndex("exampleStoreIndex", StoreIndexArgs.builder()
.project(example.projectName())
.logstore(exampleStore.logstoreName())
.fullText(StoreIndexFullTextArgs.builder()
.caseSensitive(true)
.token("""
#$^*
""")
.build())
.fieldSearches(StoreIndexFieldSearchArgs.builder()
.name("terraform-example")
.enableAnalytics(true)
.type("text")
.token("""
#$^*
""")
.build())
.build());
}
}
resources:
default:
type: random:integer
properties:
max: 99999
min: 10000
example:
type: alicloud:log:Project
properties:
projectName: terraform-example-${default.result}
description: terraform-example
exampleStore:
type: alicloud:log:Store
name: example
properties:
projectName: ${example.projectName}
logstoreName: example-store
shardCount: 3
autoSplit: true
maxSplitShardCount: 60
appendMeta: true
exampleStoreIndex:
type: alicloud:log:StoreIndex
name: example
properties:
project: ${example.projectName}
logstore: ${exampleStore.logstoreName}
fullText:
caseSensitive: true
token: " #$^*\r\n\t"
fieldSearches:
- name: terraform-example
enableAnalytics: true
type: text
token: " #$^*\r\n\t"

Module Support

You can use the existing sls module to create SLS project, store and store index one-click, like ECS instances.

Import

Log store index can be imported using the id, e.g.

$ pulumi import alicloud:log/storeIndex:StoreIndex example tf-log:tf-log-store

Constructors

Link copied to clipboard
constructor(fieldSearches: Output<List<StoreIndexFieldSearchArgs>>? = null, fullText: Output<StoreIndexFullTextArgs>? = null, logstore: Output<String>? = null, project: Output<String>? = null)

Properties

Link copied to clipboard

List configurations of field search index. Valid item as follows:

Link copied to clipboard
val fullText: Output<StoreIndexFullTextArgs>? = null

The configuration of full text index. Valid item as follows:

Link copied to clipboard
val logstore: Output<String>? = null

The log store name to the query index belongs.

Link copied to clipboard
val project: Output<String>? = null

The project name to the log store belongs.

Functions

Link copied to clipboard
open override fun toJava(): StoreIndexArgs