elasticstack 0.11.14 published on Monday, Apr 14, 2025 by elastic
elasticstack.getElasticsearchIngestProcessorJson
Explore with Pulumi AI
elasticstack 0.11.14 published on Monday, Apr 14, 2025 by elastic
Converts a JSON string into a structured JSON object.
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/json-processor.html
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as elasticstack from "@pulumi/elasticstack";
const jsonProc = elasticstack.getElasticsearchIngestProcessorJson({
    field: "string_source",
    targetField: "json_target",
});
const myIngestPipeline = new elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", {processors: [jsonProc.then(jsonProc => jsonProc.json)]});
import pulumi
import pulumi_elasticstack as elasticstack
json_proc = elasticstack.get_elasticsearch_ingest_processor_json(field="string_source",
    target_field="json_target")
my_ingest_pipeline = elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", processors=[json_proc.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 {
		jsonProc, err := elasticstack.GetElasticsearchIngestProcessorJson(ctx, &elasticstack.GetElasticsearchIngestProcessorJsonArgs{
			Field:       "string_source",
			TargetField: pulumi.StringRef("json_target"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = elasticstack.NewElasticsearchIngestPipeline(ctx, "myIngestPipeline", &elasticstack.ElasticsearchIngestPipelineArgs{
			Processors: pulumi.StringArray{
				pulumi.String(jsonProc.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 jsonProc = Elasticstack.GetElasticsearchIngestProcessorJson.Invoke(new()
    {
        Field = "string_source",
        TargetField = "json_target",
    });
    var myIngestPipeline = new Elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", new()
    {
        Processors = new[]
        {
            jsonProc.Apply(getElasticsearchIngestProcessorJsonResult => getElasticsearchIngestProcessorJsonResult.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.GetElasticsearchIngestProcessorJsonArgs;
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 jsonProc = ElasticstackFunctions.getElasticsearchIngestProcessorJson(GetElasticsearchIngestProcessorJsonArgs.builder()
            .field("string_source")
            .targetField("json_target")
            .build());
        var myIngestPipeline = new ElasticsearchIngestPipeline("myIngestPipeline", ElasticsearchIngestPipelineArgs.builder()
            .processors(jsonProc.applyValue(getElasticsearchIngestProcessorJsonResult -> getElasticsearchIngestProcessorJsonResult.json()))
            .build());
    }
}
resources:
  myIngestPipeline:
    type: elasticstack:ElasticsearchIngestPipeline
    properties:
      processors:
        - ${jsonProc.json}
variables:
  jsonProc:
    fn::invoke:
      function: elasticstack:getElasticsearchIngestProcessorJson
      arguments:
        field: string_source
        targetField: json_target
Using getElasticsearchIngestProcessorJson
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 getElasticsearchIngestProcessorJson(args: GetElasticsearchIngestProcessorJsonArgs, opts?: InvokeOptions): Promise<GetElasticsearchIngestProcessorJsonResult>
function getElasticsearchIngestProcessorJsonOutput(args: GetElasticsearchIngestProcessorJsonOutputArgs, opts?: InvokeOptions): Output<GetElasticsearchIngestProcessorJsonResult>def get_elasticsearch_ingest_processor_json(add_to_root: Optional[bool] = None,
                                            add_to_root_conflict_strategy: Optional[str] = None,
                                            allow_duplicate_keys: Optional[bool] = None,
                                            description: Optional[str] = None,
                                            field: Optional[str] = None,
                                            if_: Optional[str] = None,
                                            ignore_failure: Optional[bool] = None,
                                            on_failures: Optional[Sequence[str]] = None,
                                            tag: Optional[str] = None,
                                            target_field: Optional[str] = None,
                                            opts: Optional[InvokeOptions] = None) -> GetElasticsearchIngestProcessorJsonResult
def get_elasticsearch_ingest_processor_json_output(add_to_root: Optional[pulumi.Input[bool]] = None,
                                            add_to_root_conflict_strategy: Optional[pulumi.Input[str]] = None,
                                            allow_duplicate_keys: Optional[pulumi.Input[bool]] = None,
                                            description: Optional[pulumi.Input[str]] = None,
                                            field: Optional[pulumi.Input[str]] = None,
                                            if_: Optional[pulumi.Input[str]] = None,
                                            ignore_failure: Optional[pulumi.Input[bool]] = None,
                                            on_failures: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                            tag: Optional[pulumi.Input[str]] = None,
                                            target_field: Optional[pulumi.Input[str]] = None,
                                            opts: Optional[InvokeOptions] = None) -> Output[GetElasticsearchIngestProcessorJsonResult]func GetElasticsearchIngestProcessorJson(ctx *Context, args *GetElasticsearchIngestProcessorJsonArgs, opts ...InvokeOption) (*GetElasticsearchIngestProcessorJsonResult, error)
func GetElasticsearchIngestProcessorJsonOutput(ctx *Context, args *GetElasticsearchIngestProcessorJsonOutputArgs, opts ...InvokeOption) GetElasticsearchIngestProcessorJsonResultOutput> Note: This function is named GetElasticsearchIngestProcessorJson in the Go SDK.
public static class GetElasticsearchIngestProcessorJson 
{
    public static Task<GetElasticsearchIngestProcessorJsonResult> InvokeAsync(GetElasticsearchIngestProcessorJsonArgs args, InvokeOptions? opts = null)
    public static Output<GetElasticsearchIngestProcessorJsonResult> Invoke(GetElasticsearchIngestProcessorJsonInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetElasticsearchIngestProcessorJsonResult> getElasticsearchIngestProcessorJson(GetElasticsearchIngestProcessorJsonArgs args, InvokeOptions options)
public static Output<GetElasticsearchIngestProcessorJsonResult> getElasticsearchIngestProcessorJson(GetElasticsearchIngestProcessorJsonArgs args, InvokeOptions options)
fn::invoke:
  function: elasticstack:index/getElasticsearchIngestProcessorJson:getElasticsearchIngestProcessorJson
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Field string
 - The field to be parsed.
 - Add
To boolRoot  - Flag that forces the parsed JSON to be added at the top level of the document. 
target_fieldmust not be set when this option is chosen. - Add
To stringRoot Conflict Strategy  - When set to 
replace, root fields that conflict with fields from the parsed JSON will be overridden. When set tomerge, conflicting fields will be merged. Only applicable ifadd_to_rootis set totrue. - Allow
Duplicate boolKeys  - When set to 
true, the JSON parser will not fail if the JSON contains duplicate keys. Instead, the last encountered value for any duplicate key wins. - Description string
 - Description of the processor.
 - If string
 - Conditionally execute the processor
 - Ignore
Failure bool - Ignore failures for the processor.
 - On
Failures List<string> - Handle failures for the processor.
 - Tag string
 - Identifier for the processor.
 - Target
Field string - The field that the converted structured object will be written into. Any existing content in this field will be overwritten.
 
- Field string
 - The field to be parsed.
 - Add
To boolRoot  - Flag that forces the parsed JSON to be added at the top level of the document. 
target_fieldmust not be set when this option is chosen. - Add
To stringRoot Conflict Strategy  - When set to 
replace, root fields that conflict with fields from the parsed JSON will be overridden. When set tomerge, conflicting fields will be merged. Only applicable ifadd_to_rootis set totrue. - Allow
Duplicate boolKeys  - When set to 
true, the JSON parser will not fail if the JSON contains duplicate keys. Instead, the last encountered value for any duplicate key wins. - Description string
 - Description of the processor.
 - If string
 - Conditionally execute the processor
 - Ignore
Failure bool - Ignore failures for the processor.
 - On
Failures []string - Handle failures for the processor.
 - Tag string
 - Identifier for the processor.
 - Target
Field string - The field that the converted structured object will be written into. Any existing content in this field will be overwritten.
 
- field String
 - The field to be parsed.
 - add
To BooleanRoot  - Flag that forces the parsed JSON to be added at the top level of the document. 
target_fieldmust not be set when this option is chosen. - add
To StringRoot Conflict Strategy  - When set to 
replace, root fields that conflict with fields from the parsed JSON will be overridden. When set tomerge, conflicting fields will be merged. Only applicable ifadd_to_rootis set totrue. - allow
Duplicate BooleanKeys  - When set to 
true, the JSON parser will not fail if the JSON contains duplicate keys. Instead, the last encountered value for any duplicate key wins. - description String
 - Description of the processor.
 - if_ String
 - Conditionally execute the processor
 - ignore
Failure Boolean - Ignore failures for the processor.
 - on
Failures List<String> - Handle failures for the processor.
 - tag String
 - Identifier for the processor.
 - target
Field String - The field that the converted structured object will be written into. Any existing content in this field will be overwritten.
 
- field string
 - The field to be parsed.
 - add
To booleanRoot  - Flag that forces the parsed JSON to be added at the top level of the document. 
target_fieldmust not be set when this option is chosen. - add
To stringRoot Conflict Strategy  - When set to 
replace, root fields that conflict with fields from the parsed JSON will be overridden. When set tomerge, conflicting fields will be merged. Only applicable ifadd_to_rootis set totrue. - allow
Duplicate booleanKeys  - When set to 
true, the JSON parser will not fail if the JSON contains duplicate keys. Instead, the last encountered value for any duplicate key wins. - description string
 - Description of the processor.
 - if string
 - Conditionally execute the processor
 - ignore
Failure boolean - Ignore failures for the processor.
 - on
Failures string[] - Handle failures for the processor.
 - tag string
 - Identifier for the processor.
 - target
Field string - The field that the converted structured object will be written into. Any existing content in this field will be overwritten.
 
- field str
 - The field to be parsed.
 - add_
to_ boolroot  - Flag that forces the parsed JSON to be added at the top level of the document. 
target_fieldmust not be set when this option is chosen. - add_
to_ strroot_ conflict_ strategy  - When set to 
replace, root fields that conflict with fields from the parsed JSON will be overridden. When set tomerge, conflicting fields will be merged. Only applicable ifadd_to_rootis set totrue. - allow_
duplicate_ boolkeys  - When set to 
true, the JSON parser will not fail if the JSON contains duplicate keys. Instead, the last encountered value for any duplicate key wins. - description str
 - Description of the processor.
 - if_ str
 - Conditionally execute the processor
 - ignore_
failure bool - Ignore failures for the processor.
 - on_
failures Sequence[str] - Handle failures for the processor.
 - tag str
 - Identifier for the processor.
 - target_
field str - The field that the converted structured object will be written into. Any existing content in this field will be overwritten.
 
- field String
 - The field to be parsed.
 - add
To BooleanRoot  - Flag that forces the parsed JSON to be added at the top level of the document. 
target_fieldmust not be set when this option is chosen. - add
To StringRoot Conflict Strategy  - When set to 
replace, root fields that conflict with fields from the parsed JSON will be overridden. When set tomerge, conflicting fields will be merged. Only applicable ifadd_to_rootis set totrue. - allow
Duplicate BooleanKeys  - When set to 
true, the JSON parser will not fail if the JSON contains duplicate keys. Instead, the last encountered value for any duplicate key wins. - description String
 - Description of the processor.
 - if String
 - Conditionally execute the processor
 - ignore
Failure Boolean - Ignore failures for the processor.
 - on
Failures List<String> - Handle failures for the processor.
 - tag String
 - Identifier for the processor.
 - target
Field String - The field that the converted structured object will be written into. Any existing content in this field will be overwritten.
 
getElasticsearchIngestProcessorJson Result
The following output properties are available:
- Field string
 - The field to be parsed.
 - Id string
 - Internal identifier of the resource.
 - Json string
 - JSON representation of this data source.
 - Add
To boolRoot  - Flag that forces the parsed JSON to be added at the top level of the document. 
target_fieldmust not be set when this option is chosen. - Add
To stringRoot Conflict Strategy  - When set to 
replace, root fields that conflict with fields from the parsed JSON will be overridden. When set tomerge, conflicting fields will be merged. Only applicable ifadd_to_rootis set totrue. - Allow
Duplicate boolKeys  - When set to 
true, the JSON parser will not fail if the JSON contains duplicate keys. Instead, the last encountered value for any duplicate key wins. - Description string
 - Description of the processor.
 - If string
 - Conditionally execute the processor
 - Ignore
Failure bool - Ignore failures for the processor.
 - On
Failures List<string> - Handle failures for the processor.
 - Tag string
 - Identifier for the processor.
 - Target
Field string - The field that the converted structured object will be written into. Any existing content in this field will be overwritten.
 
- Field string
 - The field to be parsed.
 - Id string
 - Internal identifier of the resource.
 - Json string
 - JSON representation of this data source.
 - Add
To boolRoot  - Flag that forces the parsed JSON to be added at the top level of the document. 
target_fieldmust not be set when this option is chosen. - Add
To stringRoot Conflict Strategy  - When set to 
replace, root fields that conflict with fields from the parsed JSON will be overridden. When set tomerge, conflicting fields will be merged. Only applicable ifadd_to_rootis set totrue. - Allow
Duplicate boolKeys  - When set to 
true, the JSON parser will not fail if the JSON contains duplicate keys. Instead, the last encountered value for any duplicate key wins. - Description string
 - Description of the processor.
 - If string
 - Conditionally execute the processor
 - Ignore
Failure bool - Ignore failures for the processor.
 - On
Failures []string - Handle failures for the processor.
 - Tag string
 - Identifier for the processor.
 - Target
Field string - The field that the converted structured object will be written into. Any existing content in this field will be overwritten.
 
- field String
 - The field to be parsed.
 - id String
 - Internal identifier of the resource.
 - json String
 - JSON representation of this data source.
 - add
To BooleanRoot  - Flag that forces the parsed JSON to be added at the top level of the document. 
target_fieldmust not be set when this option is chosen. - add
To StringRoot Conflict Strategy  - When set to 
replace, root fields that conflict with fields from the parsed JSON will be overridden. When set tomerge, conflicting fields will be merged. Only applicable ifadd_to_rootis set totrue. - allow
Duplicate BooleanKeys  - When set to 
true, the JSON parser will not fail if the JSON contains duplicate keys. Instead, the last encountered value for any duplicate key wins. - description String
 - Description of the processor.
 - if_ String
 - Conditionally execute the processor
 - ignore
Failure Boolean - Ignore failures for the processor.
 - on
Failures List<String> - Handle failures for the processor.
 - tag String
 - Identifier for the processor.
 - target
Field String - The field that the converted structured object will be written into. Any existing content in this field will be overwritten.
 
- field string
 - The field to be parsed.
 - id string
 - Internal identifier of the resource.
 - json string
 - JSON representation of this data source.
 - add
To booleanRoot  - Flag that forces the parsed JSON to be added at the top level of the document. 
target_fieldmust not be set when this option is chosen. - add
To stringRoot Conflict Strategy  - When set to 
replace, root fields that conflict with fields from the parsed JSON will be overridden. When set tomerge, conflicting fields will be merged. Only applicable ifadd_to_rootis set totrue. - allow
Duplicate booleanKeys  - When set to 
true, the JSON parser will not fail if the JSON contains duplicate keys. Instead, the last encountered value for any duplicate key wins. - description string
 - Description of the processor.
 - if string
 - Conditionally execute the processor
 - ignore
Failure boolean - Ignore failures for the processor.
 - on
Failures string[] - Handle failures for the processor.
 - tag string
 - Identifier for the processor.
 - target
Field string - The field that the converted structured object will be written into. Any existing content in this field will be overwritten.
 
- field str
 - The field to be parsed.
 - id str
 - Internal identifier of the resource.
 - json str
 - JSON representation of this data source.
 - add_
to_ boolroot  - Flag that forces the parsed JSON to be added at the top level of the document. 
target_fieldmust not be set when this option is chosen. - add_
to_ strroot_ conflict_ strategy  - When set to 
replace, root fields that conflict with fields from the parsed JSON will be overridden. When set tomerge, conflicting fields will be merged. Only applicable ifadd_to_rootis set totrue. - allow_
duplicate_ boolkeys  - When set to 
true, the JSON parser will not fail if the JSON contains duplicate keys. Instead, the last encountered value for any duplicate key wins. - description str
 - Description of the processor.
 - if_ str
 - Conditionally execute the processor
 - ignore_
failure bool - Ignore failures for the processor.
 - on_
failures Sequence[str] - Handle failures for the processor.
 - tag str
 - Identifier for the processor.
 - target_
field str - The field that the converted structured object will be written into. Any existing content in this field will be overwritten.
 
- field String
 - The field to be parsed.
 - id String
 - Internal identifier of the resource.
 - json String
 - JSON representation of this data source.
 - add
To BooleanRoot  - Flag that forces the parsed JSON to be added at the top level of the document. 
target_fieldmust not be set when this option is chosen. - add
To StringRoot Conflict Strategy  - When set to 
replace, root fields that conflict with fields from the parsed JSON will be overridden. When set tomerge, conflicting fields will be merged. Only applicable ifadd_to_rootis set totrue. - allow
Duplicate BooleanKeys  - When set to 
true, the JSON parser will not fail if the JSON contains duplicate keys. Instead, the last encountered value for any duplicate key wins. - description String
 - Description of the processor.
 - if String
 - Conditionally execute the processor
 - ignore
Failure Boolean - Ignore failures for the processor.
 - on
Failures List<String> - Handle failures for the processor.
 - tag String
 - Identifier for the processor.
 - target
Field String - The field that the converted structured object will be written into. Any existing content in this field will be overwritten.
 
Package Details
- Repository
 - elasticstack elastic/terraform-provider-elasticstack
 - License
 - Notes
 - This Pulumi package is based on the 
elasticstackTerraform Provider. 
elasticstack 0.11.14 published on Monday, Apr 14, 2025 by elastic