Viewing docs for elasticstack 0.16.3
published on Thursday, Jul 23, 2026 by elastic
published on Thursday, Jul 23, 2026 by elastic
Viewing docs for elasticstack 0.16.3
published on Thursday, Jul 23, 2026 by elastic
published on Thursday, Jul 23, 2026 by elastic
Reads an Osquery saved query from Kibana, including prebuilt queries shipped with the osquery_manager integration. Requires Kibana 8.5.0 or later. A common use is looking up saved query IDs referenced by Security detection rule response actions.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as elasticstack from "@pulumi/elasticstack";
export = async () => {
const example = new elasticstack.KibanaOsquerySavedQuery("example", {
savedQueryId: "list_processes",
query: "SELECT pid, name FROM processes LIMIT 10;",
interval: 3600,
});
// Read a user-managed query by ID (created above or outside Terraform).
// A common use is looking up saved query IDs referenced by Security detection
// rule response actions (response_actions[].params.saved_query_id).
const managed = elasticstack.getKibanaOsquerySavedQueryOutput({
savedQueryId: example.savedQueryId,
});
// Read a prebuilt query from the osquery_manager integration.
// Prebuilt IDs vary by integration version; replace with an ID from your deployment
// (for example processes_elastic from the Kibana API client examples).
const prebuilt = await elasticstack.getKibanaOsquerySavedQuery({
savedQueryId: "processes_elastic",
});
return {
managedQuery: managed.apply(managed => managed.query),
prebuilt: prebuilt.prebuilt,
};
}
import pulumi
import pulumi_elasticstack as elasticstack
example = elasticstack.KibanaOsquerySavedQuery("example",
saved_query_id="list_processes",
query="SELECT pid, name FROM processes LIMIT 10;",
interval=3600)
# Read a user-managed query by ID (created above or outside Terraform).
# A common use is looking up saved query IDs referenced by Security detection
# rule response actions (response_actions[].params.saved_query_id).
managed = elasticstack.get_kibana_osquery_saved_query_output(saved_query_id=example.saved_query_id)
# Read a prebuilt query from the osquery_manager integration.
# Prebuilt IDs vary by integration version; replace with an ID from your deployment
# (for example processes_elastic from the Kibana API client examples).
prebuilt = elasticstack.get_kibana_osquery_saved_query(saved_query_id="processes_elastic")
pulumi.export("managedQuery", managed.query)
pulumi.export("prebuilt", prebuilt.prebuilt)
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 {
example, err := elasticstack.NewKibanaOsquerySavedQuery(ctx, "example", &elasticstack.KibanaOsquerySavedQueryArgs{
SavedQueryId: pulumi.String("list_processes"),
Query: pulumi.String("SELECT pid, name FROM processes LIMIT 10;"),
Interval: pulumi.Float64(3600),
})
if err != nil {
return err
}
// Read a user-managed query by ID (created above or outside Terraform).
// A common use is looking up saved query IDs referenced by Security detection
// rule response actions (response_actions[].params.saved_query_id).
managed := elasticstack.LookupKibanaOsquerySavedQueryOutput(ctx, elasticstack.GetKibanaOsquerySavedQueryOutputArgs{
SavedQueryId: example.SavedQueryId,
}, nil)
// Read a prebuilt query from the osquery_manager integration.
// Prebuilt IDs vary by integration version; replace with an ID from your deployment
// (for example processes_elastic from the Kibana API client examples).
prebuilt, err := elasticstack.LookupKibanaOsquerySavedQuery(ctx, &elasticstack.LookupKibanaOsquerySavedQueryArgs{
SavedQueryId: "processes_elastic",
}, nil)
if err != nil {
return err
}
ctx.Export("managedQuery", managed.ApplyT(func(managed elasticstack.GetKibanaOsquerySavedQueryResult) (*string, error) {
return &managed.Query, nil
}).(pulumi.StringPtrOutput))
ctx.Export("prebuilt", prebuilt.Prebuilt)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Elasticstack = Pulumi.Elasticstack;
return await Deployment.RunAsync(() =>
{
var example = new Elasticstack.KibanaOsquerySavedQuery("example", new()
{
SavedQueryId = "list_processes",
Query = "SELECT pid, name FROM processes LIMIT 10;",
Interval = 3600,
});
// Read a user-managed query by ID (created above or outside Terraform).
// A common use is looking up saved query IDs referenced by Security detection
// rule response actions (response_actions[].params.saved_query_id).
var managed = Elasticstack.GetKibanaOsquerySavedQuery.Invoke(new()
{
SavedQueryId = example.SavedQueryId,
});
// Read a prebuilt query from the osquery_manager integration.
// Prebuilt IDs vary by integration version; replace with an ID from your deployment
// (for example processes_elastic from the Kibana API client examples).
var prebuilt = Elasticstack.GetKibanaOsquerySavedQuery.Invoke(new()
{
SavedQueryId = "processes_elastic",
});
return new Dictionary<string, object?>
{
["managedQuery"] = managed.Apply(getKibanaOsquerySavedQueryResult => getKibanaOsquerySavedQueryResult.Query),
["prebuilt"] = prebuilt.Apply(getKibanaOsquerySavedQueryResult => getKibanaOsquerySavedQueryResult.Prebuilt),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.elasticstack.KibanaOsquerySavedQuery;
import com.pulumi.elasticstack.KibanaOsquerySavedQueryArgs;
import com.pulumi.elasticstack.ElasticstackFunctions;
import com.pulumi.elasticstack.inputs.GetKibanaOsquerySavedQueryArgs;
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 example = new KibanaOsquerySavedQuery("example", KibanaOsquerySavedQueryArgs.builder()
.savedQueryId("list_processes")
.query("SELECT pid, name FROM processes LIMIT 10;")
.interval(3600.0)
.build());
// Read a user-managed query by ID (created above or outside Terraform).
// A common use is looking up saved query IDs referenced by Security detection
// rule response actions (response_actions[].params.saved_query_id).
final var managed = ElasticstackFunctions.getKibanaOsquerySavedQuery(GetKibanaOsquerySavedQueryArgs.builder()
.savedQueryId(example.savedQueryId())
.build());
// Read a prebuilt query from the osquery_manager integration.
// Prebuilt IDs vary by integration version; replace with an ID from your deployment
// (for example processes_elastic from the Kibana API client examples).
final var prebuilt = ElasticstackFunctions.getKibanaOsquerySavedQuery(GetKibanaOsquerySavedQueryArgs.builder()
.savedQueryId("processes_elastic")
.build());
ctx.export("managedQuery", managed.applyValue(_managed -> _managed.query()));
ctx.export("prebuilt", prebuilt.prebuilt());
}
}
resources:
example:
type: elasticstack:KibanaOsquerySavedQuery
properties:
savedQueryId: list_processes
query: SELECT pid, name FROM processes LIMIT 10;
interval: 3600
variables:
# Read a user-managed query by ID (created above or outside Terraform).
# A common use is looking up saved query IDs referenced by Security detection
# rule response actions (response_actions[].params.saved_query_id).
managed:
fn::invoke:
function: elasticstack:getKibanaOsquerySavedQuery
arguments:
savedQueryId: ${example.savedQueryId}
# Read a prebuilt query from the osquery_manager integration.
# Prebuilt IDs vary by integration version; replace with an ID from your deployment
# (for example processes_elastic from the Kibana API client examples).
prebuilt:
fn::invoke:
function: elasticstack:getKibanaOsquerySavedQuery
arguments:
savedQueryId: processes_elastic
outputs:
managedQuery: ${managed.query}
prebuilt: ${prebuilt.prebuilt}
Example coming soon!
Using getKibanaOsquerySavedQuery
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 getKibanaOsquerySavedQuery(args: GetKibanaOsquerySavedQueryArgs, opts?: InvokeOptions): Promise<GetKibanaOsquerySavedQueryResult>
function getKibanaOsquerySavedQueryOutput(args: GetKibanaOsquerySavedQueryOutputArgs, opts?: InvokeOutputOptions): Output<GetKibanaOsquerySavedQueryResult>def get_kibana_osquery_saved_query(kibana_connections: Optional[Sequence[GetKibanaOsquerySavedQueryKibanaConnection]] = None,
saved_query_id: Optional[str] = None,
space_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetKibanaOsquerySavedQueryResult
def get_kibana_osquery_saved_query_output(kibana_connections: pulumi.Input[Optional[Sequence[pulumi.Input[GetKibanaOsquerySavedQueryKibanaConnectionArgs]]]] = None,
saved_query_id: pulumi.Input[Optional[str]] = None,
space_id: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetKibanaOsquerySavedQueryResult]func LookupKibanaOsquerySavedQuery(ctx *Context, args *LookupKibanaOsquerySavedQueryArgs, opts ...InvokeOption) (*LookupKibanaOsquerySavedQueryResult, error)
func LookupKibanaOsquerySavedQueryOutput(ctx *Context, args *LookupKibanaOsquerySavedQueryOutputArgs, opts ...InvokeOption) LookupKibanaOsquerySavedQueryResultOutput> Note: This function is named LookupKibanaOsquerySavedQuery in the Go SDK.
public static class GetKibanaOsquerySavedQuery
{
public static Task<GetKibanaOsquerySavedQueryResult> InvokeAsync(GetKibanaOsquerySavedQueryArgs args, InvokeOptions? opts = null)
public static Output<GetKibanaOsquerySavedQueryResult> Invoke(GetKibanaOsquerySavedQueryInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetKibanaOsquerySavedQueryResult> Invoke(GetKibanaOsquerySavedQueryInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetKibanaOsquerySavedQueryResult> getKibanaOsquerySavedQuery(GetKibanaOsquerySavedQueryArgs args, InvokeOptions options)
public static Output<GetKibanaOsquerySavedQueryResult> getKibanaOsquerySavedQuery(GetKibanaOsquerySavedQueryArgs args, InvokeOptions options)
public static Output<GetKibanaOsquerySavedQueryResult> getKibanaOsquerySavedQuery(GetKibanaOsquerySavedQueryArgs args, InvokeOutputOptions options)
fn::invoke:
function: elasticstack:index/getKibanaOsquerySavedQuery:getKibanaOsquerySavedQuery
arguments:
# arguments dictionarydata "elasticstack_get_kibana_osquery_saved_query" "name" {
# arguments
}The following arguments are supported:
- Saved
Query stringId - Stable identifier for the saved query to look up.
- Kibana
Connections List<GetKibana Osquery Saved Query Kibana Connection> - Kibana connection configuration block.
- Space
Id string - An identifier for the space. If space_id is not provided, the default space is used.
- Saved
Query stringId - Stable identifier for the saved query to look up.
- Kibana
Connections []GetKibana Osquery Saved Query Kibana Connection - Kibana connection configuration block.
- Space
Id string - An identifier for the space. If space_id is not provided, the default space is used.
- saved_
query_ stringid - Stable identifier for the saved query to look up.
- kibana_
connections list(object) - Kibana connection configuration block.
- space_
id string - An identifier for the space. If space_id is not provided, the default space is used.
- saved
Query StringId - Stable identifier for the saved query to look up.
- kibana
Connections List<GetKibana Osquery Saved Query Kibana Connection> - Kibana connection configuration block.
- space
Id String - An identifier for the space. If space_id is not provided, the default space is used.
- saved
Query stringId - Stable identifier for the saved query to look up.
- kibana
Connections GetKibana Osquery Saved Query Kibana Connection[] - Kibana connection configuration block.
- space
Id string - An identifier for the space. If space_id is not provided, the default space is used.
- saved_
query_ strid - Stable identifier for the saved query to look up.
- kibana_
connections Sequence[GetKibana Osquery Saved Query Kibana Connection] - Kibana connection configuration block.
- space_
id str - An identifier for the space. If space_id is not provided, the default space is used.
- saved
Query StringId - Stable identifier for the saved query to look up.
- kibana
Connections List<Property Map> - Kibana connection configuration block.
- space
Id String - An identifier for the space. If space_id is not provided, the default space is used.
getKibanaOsquerySavedQuery Result
The following output properties are available:
- Description string
- Human-readable description of the saved query.
- Ecs
Mapping Dictionary<string, GetKibana Osquery Saved Query Ecs Mapping> - Maps query result columns to ECS field paths.
- Id string
- Composite identifier in the form
<space_id>/<saved_query_id>. - Interval double
- Query execution interval in seconds.
- Platforms List<string>
- Target platforms for the query.
- Prebuilt bool
- Whether the saved query is prebuilt by the osquery_manager integration package.
- Query string
- Osquery SQL query text.
- Removed bool
- Whether the saved query is marked removed.
- Saved
Object stringId - Kibana saved object identifier used by Kibana's Osquery saved query detail API.
- Saved
Query stringId - Stable identifier for the saved query to look up.
- Snapshot bool
- Whether the saved query is a snapshot.
- Space
Id string - An identifier for the space. If space_id is not provided, the default space is used.
- Version string
- Saved query version string.
- Kibana
Connections List<GetKibana Osquery Saved Query Kibana Connection> - Kibana connection configuration block.
- Description string
- Human-readable description of the saved query.
- Ecs
Mapping map[string]GetKibana Osquery Saved Query Ecs Mapping - Maps query result columns to ECS field paths.
- Id string
- Composite identifier in the form
<space_id>/<saved_query_id>. - Interval float64
- Query execution interval in seconds.
- Platforms []string
- Target platforms for the query.
- Prebuilt bool
- Whether the saved query is prebuilt by the osquery_manager integration package.
- Query string
- Osquery SQL query text.
- Removed bool
- Whether the saved query is marked removed.
- Saved
Object stringId - Kibana saved object identifier used by Kibana's Osquery saved query detail API.
- Saved
Query stringId - Stable identifier for the saved query to look up.
- Snapshot bool
- Whether the saved query is a snapshot.
- Space
Id string - An identifier for the space. If space_id is not provided, the default space is used.
- Version string
- Saved query version string.
- Kibana
Connections []GetKibana Osquery Saved Query Kibana Connection - Kibana connection configuration block.
- description string
- Human-readable description of the saved query.
- ecs_
mapping map(object) - Maps query result columns to ECS field paths.
- id string
- Composite identifier in the form
<space_id>/<saved_query_id>. - interval number
- Query execution interval in seconds.
- platforms list(string)
- Target platforms for the query.
- prebuilt bool
- Whether the saved query is prebuilt by the osquery_manager integration package.
- query string
- Osquery SQL query text.
- removed bool
- Whether the saved query is marked removed.
- saved_
object_ stringid - Kibana saved object identifier used by Kibana's Osquery saved query detail API.
- saved_
query_ stringid - Stable identifier for the saved query to look up.
- snapshot bool
- Whether the saved query is a snapshot.
- space_
id string - An identifier for the space. If space_id is not provided, the default space is used.
- version string
- Saved query version string.
- kibana_
connections list(object) - Kibana connection configuration block.
- description String
- Human-readable description of the saved query.
- ecs
Mapping Map<String,GetKibana Osquery Saved Query Ecs Mapping> - Maps query result columns to ECS field paths.
- id String
- Composite identifier in the form
<space_id>/<saved_query_id>. - interval Double
- Query execution interval in seconds.
- platforms List<String>
- Target platforms for the query.
- prebuilt Boolean
- Whether the saved query is prebuilt by the osquery_manager integration package.
- query String
- Osquery SQL query text.
- removed Boolean
- Whether the saved query is marked removed.
- saved
Object StringId - Kibana saved object identifier used by Kibana's Osquery saved query detail API.
- saved
Query StringId - Stable identifier for the saved query to look up.
- snapshot Boolean
- Whether the saved query is a snapshot.
- space
Id String - An identifier for the space. If space_id is not provided, the default space is used.
- version String
- Saved query version string.
- kibana
Connections List<GetKibana Osquery Saved Query Kibana Connection> - Kibana connection configuration block.
- description string
- Human-readable description of the saved query.
- ecs
Mapping {[key: string]: GetKibana Osquery Saved Query Ecs Mapping} - Maps query result columns to ECS field paths.
- id string
- Composite identifier in the form
<space_id>/<saved_query_id>. - interval number
- Query execution interval in seconds.
- platforms string[]
- Target platforms for the query.
- prebuilt boolean
- Whether the saved query is prebuilt by the osquery_manager integration package.
- query string
- Osquery SQL query text.
- removed boolean
- Whether the saved query is marked removed.
- saved
Object stringId - Kibana saved object identifier used by Kibana's Osquery saved query detail API.
- saved
Query stringId - Stable identifier for the saved query to look up.
- snapshot boolean
- Whether the saved query is a snapshot.
- space
Id string - An identifier for the space. If space_id is not provided, the default space is used.
- version string
- Saved query version string.
- kibana
Connections GetKibana Osquery Saved Query Kibana Connection[] - Kibana connection configuration block.
- description str
- Human-readable description of the saved query.
- ecs_
mapping Mapping[str, GetKibana Osquery Saved Query Ecs Mapping] - Maps query result columns to ECS field paths.
- id str
- Composite identifier in the form
<space_id>/<saved_query_id>. - interval float
- Query execution interval in seconds.
- platforms Sequence[str]
- Target platforms for the query.
- prebuilt bool
- Whether the saved query is prebuilt by the osquery_manager integration package.
- query str
- Osquery SQL query text.
- removed bool
- Whether the saved query is marked removed.
- saved_
object_ strid - Kibana saved object identifier used by Kibana's Osquery saved query detail API.
- saved_
query_ strid - Stable identifier for the saved query to look up.
- snapshot bool
- Whether the saved query is a snapshot.
- space_
id str - An identifier for the space. If space_id is not provided, the default space is used.
- version str
- Saved query version string.
- kibana_
connections Sequence[GetKibana Osquery Saved Query Kibana Connection] - Kibana connection configuration block.
- description String
- Human-readable description of the saved query.
- ecs
Mapping Map<Property Map> - Maps query result columns to ECS field paths.
- id String
- Composite identifier in the form
<space_id>/<saved_query_id>. - interval Number
- Query execution interval in seconds.
- platforms List<String>
- Target platforms for the query.
- prebuilt Boolean
- Whether the saved query is prebuilt by the osquery_manager integration package.
- query String
- Osquery SQL query text.
- removed Boolean
- Whether the saved query is marked removed.
- saved
Object StringId - Kibana saved object identifier used by Kibana's Osquery saved query detail API.
- saved
Query StringId - Stable identifier for the saved query to look up.
- snapshot Boolean
- Whether the saved query is a snapshot.
- space
Id String - An identifier for the space. If space_id is not provided, the default space is used.
- version String
- Saved query version string.
- kibana
Connections List<Property Map> - Kibana connection configuration block.
Supporting Types
GetKibanaOsquerySavedQueryEcsMapping
GetKibanaOsquerySavedQueryKibanaConnection
- Api
Key string - API Key to use for authentication to Kibana
- Bearer
Token string - Bearer Token to use for authentication to Kibana
- Ca
Certs List<string> - A list of paths to CA certificates to validate the certificate presented by the Kibana server.
- Endpoints List<string>
- Insecure bool
- Disable TLS certificate validation
- Password string
- Password to use for API authentication to Kibana.
- Username string
- Username to use for API authentication to Kibana.
- Api
Key string - API Key to use for authentication to Kibana
- Bearer
Token string - Bearer Token to use for authentication to Kibana
- Ca
Certs []string - A list of paths to CA certificates to validate the certificate presented by the Kibana server.
- Endpoints []string
- Insecure bool
- Disable TLS certificate validation
- Password string
- Password to use for API authentication to Kibana.
- Username string
- Username to use for API authentication to Kibana.
- api_
key string - API Key to use for authentication to Kibana
- bearer_
token string - Bearer Token to use for authentication to Kibana
- ca_
certs list(string) - A list of paths to CA certificates to validate the certificate presented by the Kibana server.
- endpoints list(string)
- insecure bool
- Disable TLS certificate validation
- password string
- Password to use for API authentication to Kibana.
- username string
- Username to use for API authentication to Kibana.
- api
Key String - API Key to use for authentication to Kibana
- bearer
Token String - Bearer Token to use for authentication to Kibana
- ca
Certs List<String> - A list of paths to CA certificates to validate the certificate presented by the Kibana server.
- endpoints List<String>
- insecure Boolean
- Disable TLS certificate validation
- password String
- Password to use for API authentication to Kibana.
- username String
- Username to use for API authentication to Kibana.
- api
Key string - API Key to use for authentication to Kibana
- bearer
Token string - Bearer Token to use for authentication to Kibana
- ca
Certs string[] - A list of paths to CA certificates to validate the certificate presented by the Kibana server.
- endpoints string[]
- insecure boolean
- Disable TLS certificate validation
- password string
- Password to use for API authentication to Kibana.
- username string
- Username to use for API authentication to Kibana.
- api_
key str - API Key to use for authentication to Kibana
- bearer_
token str - Bearer Token to use for authentication to Kibana
- ca_
certs Sequence[str] - A list of paths to CA certificates to validate the certificate presented by the Kibana server.
- endpoints Sequence[str]
- insecure bool
- Disable TLS certificate validation
- password str
- Password to use for API authentication to Kibana.
- username str
- Username to use for API authentication to Kibana.
- api
Key String - API Key to use for authentication to Kibana
- bearer
Token String - Bearer Token to use for authentication to Kibana
- ca
Certs List<String> - A list of paths to CA certificates to validate the certificate presented by the Kibana server.
- endpoints List<String>
- insecure Boolean
- Disable TLS certificate validation
- password String
- Password to use for API authentication to Kibana.
- username String
- Username to use for API authentication to Kibana.
Package Details
- Repository
- elasticstack elastic/terraform-provider-elasticstack
- License
- Notes
- This Pulumi package is based on the
elasticstackTerraform Provider.
Viewing docs for elasticstack 0.16.3
published on Thursday, Jul 23, 2026 by elastic
published on Thursday, Jul 23, 2026 by elastic