elasticstack.getElasticsearchIngestProcessorUserAgent
Explore with Pulumi AI
The user_agent
processor extracts details from the user agent string a browser sends with its web requests. This processor adds this information by default under the user_agent
field.
The ingest-user-agent module ships by default with the regexes.yaml made available by uap-java with an Apache 2.0 license. For more details see https://github.com/ua-parser/uap-core.
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/user-agent-processor.html
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as elasticstack from "@pulumi/elasticstack";
const agent = elasticstack.getElasticsearchIngestProcessorUserAgent({
field: "agent",
});
const myIngestPipeline = new elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", {processors: [agent.then(agent => agent.json)]});
import pulumi
import pulumi_elasticstack as elasticstack
agent = elasticstack.get_elasticsearch_ingest_processor_user_agent(field="agent")
my_ingest_pipeline = elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", processors=[agent.json])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/elasticstack/elasticstack"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
agent, err := elasticstack.GetElasticsearchIngestProcessorUserAgent(ctx, &elasticstack.GetElasticsearchIngestProcessorUserAgentArgs{
Field: "agent",
}, nil)
if err != nil {
return err
}
_, err = elasticstack.NewElasticsearchIngestPipeline(ctx, "myIngestPipeline", &elasticstack.ElasticsearchIngestPipelineArgs{
Processors: pulumi.StringArray{
pulumi.String(agent.Json),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Elasticstack = Pulumi.Elasticstack;
return await Deployment.RunAsync(() =>
{
var agent = Elasticstack.GetElasticsearchIngestProcessorUserAgent.Invoke(new()
{
Field = "agent",
});
var myIngestPipeline = new Elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", new()
{
Processors = new[]
{
agent.Apply(getElasticsearchIngestProcessorUserAgentResult => getElasticsearchIngestProcessorUserAgentResult.Json),
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.elasticstack.ElasticstackFunctions;
import com.pulumi.elasticstack.inputs.GetElasticsearchIngestProcessorUserAgentArgs;
import com.pulumi.elasticstack.ElasticsearchIngestPipeline;
import com.pulumi.elasticstack.ElasticsearchIngestPipelineArgs;
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) {
final var agent = ElasticstackFunctions.getElasticsearchIngestProcessorUserAgent(GetElasticsearchIngestProcessorUserAgentArgs.builder()
.field("agent")
.build());
var myIngestPipeline = new ElasticsearchIngestPipeline("myIngestPipeline", ElasticsearchIngestPipelineArgs.builder()
.processors(agent.applyValue(getElasticsearchIngestProcessorUserAgentResult -> getElasticsearchIngestProcessorUserAgentResult.json()))
.build());
}
}
resources:
myIngestPipeline:
type: elasticstack:ElasticsearchIngestPipeline
properties:
processors:
- ${agent.json}
variables:
agent:
fn::invoke:
function: elasticstack:getElasticsearchIngestProcessorUserAgent
arguments:
field: agent
Using getElasticsearchIngestProcessorUserAgent
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getElasticsearchIngestProcessorUserAgent(args: GetElasticsearchIngestProcessorUserAgentArgs, opts?: InvokeOptions): Promise<GetElasticsearchIngestProcessorUserAgentResult>
function getElasticsearchIngestProcessorUserAgentOutput(args: GetElasticsearchIngestProcessorUserAgentOutputArgs, opts?: InvokeOptions): Output<GetElasticsearchIngestProcessorUserAgentResult>
def get_elasticsearch_ingest_processor_user_agent(extract_device_type: Optional[bool] = None,
field: Optional[str] = None,
ignore_missing: Optional[bool] = None,
properties: Optional[Sequence[str]] = None,
regex_file: Optional[str] = None,
target_field: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetElasticsearchIngestProcessorUserAgentResult
def get_elasticsearch_ingest_processor_user_agent_output(extract_device_type: Optional[pulumi.Input[bool]] = None,
field: Optional[pulumi.Input[str]] = None,
ignore_missing: Optional[pulumi.Input[bool]] = None,
properties: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
regex_file: Optional[pulumi.Input[str]] = None,
target_field: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetElasticsearchIngestProcessorUserAgentResult]
func GetElasticsearchIngestProcessorUserAgent(ctx *Context, args *GetElasticsearchIngestProcessorUserAgentArgs, opts ...InvokeOption) (*GetElasticsearchIngestProcessorUserAgentResult, error)
func GetElasticsearchIngestProcessorUserAgentOutput(ctx *Context, args *GetElasticsearchIngestProcessorUserAgentOutputArgs, opts ...InvokeOption) GetElasticsearchIngestProcessorUserAgentResultOutput
> Note: This function is named GetElasticsearchIngestProcessorUserAgent
in the Go SDK.
public static class GetElasticsearchIngestProcessorUserAgent
{
public static Task<GetElasticsearchIngestProcessorUserAgentResult> InvokeAsync(GetElasticsearchIngestProcessorUserAgentArgs args, InvokeOptions? opts = null)
public static Output<GetElasticsearchIngestProcessorUserAgentResult> Invoke(GetElasticsearchIngestProcessorUserAgentInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetElasticsearchIngestProcessorUserAgentResult> getElasticsearchIngestProcessorUserAgent(GetElasticsearchIngestProcessorUserAgentArgs args, InvokeOptions options)
public static Output<GetElasticsearchIngestProcessorUserAgentResult> getElasticsearchIngestProcessorUserAgent(GetElasticsearchIngestProcessorUserAgentArgs args, InvokeOptions options)
fn::invoke:
function: elasticstack:index/getElasticsearchIngestProcessorUserAgent:getElasticsearchIngestProcessorUserAgent
arguments:
# arguments dictionary
The following arguments are supported:
- Field string
- The field containing the user agent string.
- Extract
Device boolType - Extracts device type from the user agent string on a best-effort basis. Supported only starting from Elasticsearch version 8.0
- Ignore
Missing bool - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - Properties List<string>
- Controls what properties are added to
target_field
. - Regex
File string - The name of the file in the
config/ingest-user-agent
directory containing the regular expressions for parsing the user agent string. - Target
Field string - The field that will be filled with the user agent details.
- Field string
- The field containing the user agent string.
- Extract
Device boolType - Extracts device type from the user agent string on a best-effort basis. Supported only starting from Elasticsearch version 8.0
- Ignore
Missing bool - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - Properties []string
- Controls what properties are added to
target_field
. - Regex
File string - The name of the file in the
config/ingest-user-agent
directory containing the regular expressions for parsing the user agent string. - Target
Field string - The field that will be filled with the user agent details.
- field String
- The field containing the user agent string.
- extract
Device BooleanType - Extracts device type from the user agent string on a best-effort basis. Supported only starting from Elasticsearch version 8.0
- ignore
Missing Boolean - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - properties List<String>
- Controls what properties are added to
target_field
. - regex
File String - The name of the file in the
config/ingest-user-agent
directory containing the regular expressions for parsing the user agent string. - target
Field String - The field that will be filled with the user agent details.
- field string
- The field containing the user agent string.
- extract
Device booleanType - Extracts device type from the user agent string on a best-effort basis. Supported only starting from Elasticsearch version 8.0
- ignore
Missing boolean - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - properties string[]
- Controls what properties are added to
target_field
. - regex
File string - The name of the file in the
config/ingest-user-agent
directory containing the regular expressions for parsing the user agent string. - target
Field string - The field that will be filled with the user agent details.
- field str
- The field containing the user agent string.
- extract_
device_ booltype - Extracts device type from the user agent string on a best-effort basis. Supported only starting from Elasticsearch version 8.0
- ignore_
missing bool - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - properties Sequence[str]
- Controls what properties are added to
target_field
. - regex_
file str - The name of the file in the
config/ingest-user-agent
directory containing the regular expressions for parsing the user agent string. - target_
field str - The field that will be filled with the user agent details.
- field String
- The field containing the user agent string.
- extract
Device BooleanType - Extracts device type from the user agent string on a best-effort basis. Supported only starting from Elasticsearch version 8.0
- ignore
Missing Boolean - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - properties List<String>
- Controls what properties are added to
target_field
. - regex
File String - The name of the file in the
config/ingest-user-agent
directory containing the regular expressions for parsing the user agent string. - target
Field String - The field that will be filled with the user agent details.
getElasticsearchIngestProcessorUserAgent Result
The following output properties are available:
- Field string
- The field containing the user agent string.
- Id string
- Internal identifier of the resource.
- Json string
- JSON representation of this data source.
- Extract
Device boolType - Extracts device type from the user agent string on a best-effort basis. Supported only starting from Elasticsearch version 8.0
- Ignore
Missing bool - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - Properties List<string>
- Controls what properties are added to
target_field
. - Regex
File string - The name of the file in the
config/ingest-user-agent
directory containing the regular expressions for parsing the user agent string. - Target
Field string - The field that will be filled with the user agent details.
- Field string
- The field containing the user agent string.
- Id string
- Internal identifier of the resource.
- Json string
- JSON representation of this data source.
- Extract
Device boolType - Extracts device type from the user agent string on a best-effort basis. Supported only starting from Elasticsearch version 8.0
- Ignore
Missing bool - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - Properties []string
- Controls what properties are added to
target_field
. - Regex
File string - The name of the file in the
config/ingest-user-agent
directory containing the regular expressions for parsing the user agent string. - Target
Field string - The field that will be filled with the user agent details.
- field String
- The field containing the user agent string.
- id String
- Internal identifier of the resource.
- json String
- JSON representation of this data source.
- extract
Device BooleanType - Extracts device type from the user agent string on a best-effort basis. Supported only starting from Elasticsearch version 8.0
- ignore
Missing Boolean - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - properties List<String>
- Controls what properties are added to
target_field
. - regex
File String - The name of the file in the
config/ingest-user-agent
directory containing the regular expressions for parsing the user agent string. - target
Field String - The field that will be filled with the user agent details.
- field string
- The field containing the user agent string.
- id string
- Internal identifier of the resource.
- json string
- JSON representation of this data source.
- extract
Device booleanType - Extracts device type from the user agent string on a best-effort basis. Supported only starting from Elasticsearch version 8.0
- ignore
Missing boolean - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - properties string[]
- Controls what properties are added to
target_field
. - regex
File string - The name of the file in the
config/ingest-user-agent
directory containing the regular expressions for parsing the user agent string. - target
Field string - The field that will be filled with the user agent details.
- field str
- The field containing the user agent string.
- id str
- Internal identifier of the resource.
- json str
- JSON representation of this data source.
- extract_
device_ booltype - Extracts device type from the user agent string on a best-effort basis. Supported only starting from Elasticsearch version 8.0
- ignore_
missing bool - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - properties Sequence[str]
- Controls what properties are added to
target_field
. - regex_
file str - The name of the file in the
config/ingest-user-agent
directory containing the regular expressions for parsing the user agent string. - target_
field str - The field that will be filled with the user agent details.
- field String
- The field containing the user agent string.
- id String
- Internal identifier of the resource.
- json String
- JSON representation of this data source.
- extract
Device BooleanType - Extracts device type from the user agent string on a best-effort basis. Supported only starting from Elasticsearch version 8.0
- ignore
Missing Boolean - If
true
andfield
does not exist or isnull
, the processor quietly exits without modifying the document. - properties List<String>
- Controls what properties are added to
target_field
. - regex
File String - The name of the file in the
config/ingest-user-agent
directory containing the regular expressions for parsing the user agent string. - target
Field String - The field that will be filled with the user agent details.
Package Details
- Repository
- elasticstack elastic/terraform-provider-elasticstack
- License
- Notes
- This Pulumi package is based on the
elasticstack
Terraform Provider.