elasticstack.getElasticsearchIngestProcessorNetworkDirection
Explore with Pulumi AI
Calculates the network direction given a source IP address, destination IP address, and a list of internal networks.
The network direction processor reads IP addresses from Elastic Common Schema (ECS) fields by default. If you use the ECS, only the internal_networks option must be specified.
One of either internal_networks or internal_networks_field must be specified. If internal_networks_field is specified, it follows the behavior specified by ignore_missing.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as elasticstack from "@pulumi/elasticstack";
const networkDirection = elasticstack.getElasticsearchIngestProcessorNetworkDirection({
    internalNetworks: ["private"],
});
const myIngestPipeline = new elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", {processors: [networkDirection.then(networkDirection => networkDirection.json)]});
import pulumi
import pulumi_elasticstack as elasticstack
network_direction = elasticstack.get_elasticsearch_ingest_processor_network_direction(internal_networks=["private"])
my_ingest_pipeline = elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", processors=[network_direction.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 {
		networkDirection, err := elasticstack.GetElasticsearchIngestProcessorNetworkDirection(ctx, &elasticstack.GetElasticsearchIngestProcessorNetworkDirectionArgs{
			InternalNetworks: []string{
				"private",
			},
		}, nil)
		if err != nil {
			return err
		}
		_, err = elasticstack.NewElasticsearchIngestPipeline(ctx, "myIngestPipeline", &elasticstack.ElasticsearchIngestPipelineArgs{
			Processors: pulumi.StringArray{
				pulumi.String(networkDirection.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 networkDirection = Elasticstack.GetElasticsearchIngestProcessorNetworkDirection.Invoke(new()
    {
        InternalNetworks = new[]
        {
            "private",
        },
    });
    var myIngestPipeline = new Elasticstack.ElasticsearchIngestPipeline("myIngestPipeline", new()
    {
        Processors = new[]
        {
            networkDirection.Apply(getElasticsearchIngestProcessorNetworkDirectionResult => getElasticsearchIngestProcessorNetworkDirectionResult.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.GetElasticsearchIngestProcessorNetworkDirectionArgs;
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 networkDirection = ElasticstackFunctions.getElasticsearchIngestProcessorNetworkDirection(GetElasticsearchIngestProcessorNetworkDirectionArgs.builder()
            .internalNetworks("private")
            .build());
        var myIngestPipeline = new ElasticsearchIngestPipeline("myIngestPipeline", ElasticsearchIngestPipelineArgs.builder()
            .processors(networkDirection.applyValue(getElasticsearchIngestProcessorNetworkDirectionResult -> getElasticsearchIngestProcessorNetworkDirectionResult.json()))
            .build());
    }
}
resources:
  myIngestPipeline:
    type: elasticstack:ElasticsearchIngestPipeline
    properties:
      processors:
        - ${networkDirection.json}
variables:
  networkDirection:
    fn::invoke:
      function: elasticstack:getElasticsearchIngestProcessorNetworkDirection
      arguments:
        internalNetworks:
          - private
Using getElasticsearchIngestProcessorNetworkDirection
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 getElasticsearchIngestProcessorNetworkDirection(args: GetElasticsearchIngestProcessorNetworkDirectionArgs, opts?: InvokeOptions): Promise<GetElasticsearchIngestProcessorNetworkDirectionResult>
function getElasticsearchIngestProcessorNetworkDirectionOutput(args: GetElasticsearchIngestProcessorNetworkDirectionOutputArgs, opts?: InvokeOptions): Output<GetElasticsearchIngestProcessorNetworkDirectionResult>def get_elasticsearch_ingest_processor_network_direction(description: Optional[str] = None,
                                                         destination_ip: Optional[str] = None,
                                                         if_: Optional[str] = None,
                                                         ignore_failure: Optional[bool] = None,
                                                         ignore_missing: Optional[bool] = None,
                                                         internal_networks: Optional[Sequence[str]] = None,
                                                         internal_networks_field: Optional[str] = None,
                                                         on_failures: Optional[Sequence[str]] = None,
                                                         source_ip: Optional[str] = None,
                                                         tag: Optional[str] = None,
                                                         target_field: Optional[str] = None,
                                                         opts: Optional[InvokeOptions] = None) -> GetElasticsearchIngestProcessorNetworkDirectionResult
def get_elasticsearch_ingest_processor_network_direction_output(description: Optional[pulumi.Input[str]] = None,
                                                         destination_ip: Optional[pulumi.Input[str]] = None,
                                                         if_: Optional[pulumi.Input[str]] = None,
                                                         ignore_failure: Optional[pulumi.Input[bool]] = None,
                                                         ignore_missing: Optional[pulumi.Input[bool]] = None,
                                                         internal_networks: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                                         internal_networks_field: Optional[pulumi.Input[str]] = None,
                                                         on_failures: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                                         source_ip: Optional[pulumi.Input[str]] = None,
                                                         tag: Optional[pulumi.Input[str]] = None,
                                                         target_field: Optional[pulumi.Input[str]] = None,
                                                         opts: Optional[InvokeOptions] = None) -> Output[GetElasticsearchIngestProcessorNetworkDirectionResult]func GetElasticsearchIngestProcessorNetworkDirection(ctx *Context, args *GetElasticsearchIngestProcessorNetworkDirectionArgs, opts ...InvokeOption) (*GetElasticsearchIngestProcessorNetworkDirectionResult, error)
func GetElasticsearchIngestProcessorNetworkDirectionOutput(ctx *Context, args *GetElasticsearchIngestProcessorNetworkDirectionOutputArgs, opts ...InvokeOption) GetElasticsearchIngestProcessorNetworkDirectionResultOutput> Note: This function is named GetElasticsearchIngestProcessorNetworkDirection in the Go SDK.
public static class GetElasticsearchIngestProcessorNetworkDirection 
{
    public static Task<GetElasticsearchIngestProcessorNetworkDirectionResult> InvokeAsync(GetElasticsearchIngestProcessorNetworkDirectionArgs args, InvokeOptions? opts = null)
    public static Output<GetElasticsearchIngestProcessorNetworkDirectionResult> Invoke(GetElasticsearchIngestProcessorNetworkDirectionInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetElasticsearchIngestProcessorNetworkDirectionResult> getElasticsearchIngestProcessorNetworkDirection(GetElasticsearchIngestProcessorNetworkDirectionArgs args, InvokeOptions options)
public static Output<GetElasticsearchIngestProcessorNetworkDirectionResult> getElasticsearchIngestProcessorNetworkDirection(GetElasticsearchIngestProcessorNetworkDirectionArgs args, InvokeOptions options)
fn::invoke:
  function: elasticstack:index/getElasticsearchIngestProcessorNetworkDirection:getElasticsearchIngestProcessorNetworkDirection
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Description string
 - Description of the processor.
 - Destination
Ip string - Field containing the destination IP address.
 - If string
 - Conditionally execute the processor
 - Ignore
Failure bool - Ignore failures for the processor.
 - Ignore
Missing bool - If 
trueandfielddoes not exist or isnull, the processor quietly exits without modifying the document. - Internal
Networks List<string> - List of internal networks.
 - Internal
Networks stringField  - A field on the given document to read the internal_networks configuration from.
 - On
Failures List<string> - Handle failures for the processor.
 - Source
Ip string - Field containing the source IP address.
 - Tag string
 - Identifier for the processor.
 - Target
Field string - Output field for the network direction.
 
- Description string
 - Description of the processor.
 - Destination
Ip string - Field containing the destination IP address.
 - If string
 - Conditionally execute the processor
 - Ignore
Failure bool - Ignore failures for the processor.
 - Ignore
Missing bool - If 
trueandfielddoes not exist or isnull, the processor quietly exits without modifying the document. - Internal
Networks []string - List of internal networks.
 - Internal
Networks stringField  - A field on the given document to read the internal_networks configuration from.
 - On
Failures []string - Handle failures for the processor.
 - Source
Ip string - Field containing the source IP address.
 - Tag string
 - Identifier for the processor.
 - Target
Field string - Output field for the network direction.
 
- description String
 - Description of the processor.
 - destination
Ip String - Field containing the destination IP address.
 - if_ String
 - Conditionally execute the processor
 - ignore
Failure Boolean - Ignore failures for the processor.
 - ignore
Missing Boolean - If 
trueandfielddoes not exist or isnull, the processor quietly exits without modifying the document. - internal
Networks List<String> - List of internal networks.
 - internal
Networks StringField  - A field on the given document to read the internal_networks configuration from.
 - on
Failures List<String> - Handle failures for the processor.
 - source
Ip String - Field containing the source IP address.
 - tag String
 - Identifier for the processor.
 - target
Field String - Output field for the network direction.
 
- description string
 - Description of the processor.
 - destination
Ip string - Field containing the destination IP address.
 - if string
 - Conditionally execute the processor
 - ignore
Failure boolean - Ignore failures for the processor.
 - ignore
Missing boolean - If 
trueandfielddoes not exist or isnull, the processor quietly exits without modifying the document. - internal
Networks string[] - List of internal networks.
 - internal
Networks stringField  - A field on the given document to read the internal_networks configuration from.
 - on
Failures string[] - Handle failures for the processor.
 - source
Ip string - Field containing the source IP address.
 - tag string
 - Identifier for the processor.
 - target
Field string - Output field for the network direction.
 
- description str
 - Description of the processor.
 - destination_
ip str - Field containing the destination IP address.
 - if_ str
 - Conditionally execute the processor
 - ignore_
failure bool - Ignore failures for the processor.
 - ignore_
missing bool - If 
trueandfielddoes not exist or isnull, the processor quietly exits without modifying the document. - internal_
networks Sequence[str] - List of internal networks.
 - internal_
networks_ strfield  - A field on the given document to read the internal_networks configuration from.
 - on_
failures Sequence[str] - Handle failures for the processor.
 - source_
ip str - Field containing the source IP address.
 - tag str
 - Identifier for the processor.
 - target_
field str - Output field for the network direction.
 
- description String
 - Description of the processor.
 - destination
Ip String - Field containing the destination IP address.
 - if String
 - Conditionally execute the processor
 - ignore
Failure Boolean - Ignore failures for the processor.
 - ignore
Missing Boolean - If 
trueandfielddoes not exist or isnull, the processor quietly exits without modifying the document. - internal
Networks List<String> - List of internal networks.
 - internal
Networks StringField  - A field on the given document to read the internal_networks configuration from.
 - on
Failures List<String> - Handle failures for the processor.
 - source
Ip String - Field containing the source IP address.
 - tag String
 - Identifier for the processor.
 - target
Field String - Output field for the network direction.
 
getElasticsearchIngestProcessorNetworkDirection Result
The following output properties are available:
- Id string
 - Internal identifier of the resource.
 - Json string
 - JSON representation of this data source.
 - Description string
 - Description of the processor.
 - Destination
Ip string - Field containing the destination IP address.
 - If string
 - Conditionally execute the processor
 - Ignore
Failure bool - Ignore failures for the processor.
 - Ignore
Missing bool - If 
trueandfielddoes not exist or isnull, the processor quietly exits without modifying the document. - Internal
Networks List<string> - List of internal networks.
 - Internal
Networks stringField  - A field on the given document to read the internal_networks configuration from.
 - On
Failures List<string> - Handle failures for the processor.
 - Source
Ip string - Field containing the source IP address.
 - Tag string
 - Identifier for the processor.
 - Target
Field string - Output field for the network direction.
 
- Id string
 - Internal identifier of the resource.
 - Json string
 - JSON representation of this data source.
 - Description string
 - Description of the processor.
 - Destination
Ip string - Field containing the destination IP address.
 - If string
 - Conditionally execute the processor
 - Ignore
Failure bool - Ignore failures for the processor.
 - Ignore
Missing bool - If 
trueandfielddoes not exist or isnull, the processor quietly exits without modifying the document. - Internal
Networks []string - List of internal networks.
 - Internal
Networks stringField  - A field on the given document to read the internal_networks configuration from.
 - On
Failures []string - Handle failures for the processor.
 - Source
Ip string - Field containing the source IP address.
 - Tag string
 - Identifier for the processor.
 - Target
Field string - Output field for the network direction.
 
- id String
 - Internal identifier of the resource.
 - json String
 - JSON representation of this data source.
 - description String
 - Description of the processor.
 - destination
Ip String - Field containing the destination IP address.
 - if_ String
 - Conditionally execute the processor
 - ignore
Failure Boolean - Ignore failures for the processor.
 - ignore
Missing Boolean - If 
trueandfielddoes not exist or isnull, the processor quietly exits without modifying the document. - internal
Networks List<String> - List of internal networks.
 - internal
Networks StringField  - A field on the given document to read the internal_networks configuration from.
 - on
Failures List<String> - Handle failures for the processor.
 - source
Ip String - Field containing the source IP address.
 - tag String
 - Identifier for the processor.
 - target
Field String - Output field for the network direction.
 
- id string
 - Internal identifier of the resource.
 - json string
 - JSON representation of this data source.
 - description string
 - Description of the processor.
 - destination
Ip string - Field containing the destination IP address.
 - if string
 - Conditionally execute the processor
 - ignore
Failure boolean - Ignore failures for the processor.
 - ignore
Missing boolean - If 
trueandfielddoes not exist or isnull, the processor quietly exits without modifying the document. - internal
Networks string[] - List of internal networks.
 - internal
Networks stringField  - A field on the given document to read the internal_networks configuration from.
 - on
Failures string[] - Handle failures for the processor.
 - source
Ip string - Field containing the source IP address.
 - tag string
 - Identifier for the processor.
 - target
Field string - Output field for the network direction.
 
- id str
 - Internal identifier of the resource.
 - json str
 - JSON representation of this data source.
 - description str
 - Description of the processor.
 - destination_
ip str - Field containing the destination IP address.
 - if_ str
 - Conditionally execute the processor
 - ignore_
failure bool - Ignore failures for the processor.
 - ignore_
missing bool - If 
trueandfielddoes not exist or isnull, the processor quietly exits without modifying the document. - internal_
networks Sequence[str] - List of internal networks.
 - internal_
networks_ strfield  - A field on the given document to read the internal_networks configuration from.
 - on_
failures Sequence[str] - Handle failures for the processor.
 - source_
ip str - Field containing the source IP address.
 - tag str
 - Identifier for the processor.
 - target_
field str - Output field for the network direction.
 
- id String
 - Internal identifier of the resource.
 - json String
 - JSON representation of this data source.
 - description String
 - Description of the processor.
 - destination
Ip String - Field containing the destination IP address.
 - if String
 - Conditionally execute the processor
 - ignore
Failure Boolean - Ignore failures for the processor.
 - ignore
Missing Boolean - If 
trueandfielddoes not exist or isnull, the processor quietly exits without modifying the document. - internal
Networks List<String> - List of internal networks.
 - internal
Networks StringField  - A field on the given document to read the internal_networks configuration from.
 - on
Failures List<String> - Handle failures for the processor.
 - source
Ip String - Field containing the source IP address.
 - tag String
 - Identifier for the processor.
 - target
Field String - Output field for the network direction.
 
Package Details
- Repository
 - elasticstack elastic/terraform-provider-elasticstack
 - License
 - Notes
 - This Pulumi package is based on the 
elasticstackTerraform Provider.