@pulumi/sumologic
Version:
A Pulumi package for creating and managing sumologic cloud resources.
179 lines • 6.9 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.LogSearch = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a Sumologic Log Search.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as sumologic from "@pulumi/sumologic";
*
* const personalFolder = sumologic.getPersonalFolder({});
* const exampleLogSearch = new sumologic.LogSearch("example_log_search", {
* name: "Demo Search",
* description: "Demo search description",
* parentId: personalFolder.then(personalFolder => personalFolder.id),
* queryString: ` _sourceCategory=api
* | parse "parameter1=*," as parameter1
* | parse "parameter2=*," as parameter2
* | where parameter1 matches {{param1}}
* | where parameter2 matches {{param2}}
* | count by _sourceHost
* `,
* parsingMode: "AutoParse",
* runByReceiptTime: true,
* timeRange: {
* beginBoundedTimeRange: {
* from: {
* relativeTimeRange: {
* relativeTime: "-30m",
* },
* },
* },
* },
* queryParameters: [
* {
* name: "param1",
* description: "Description for param1",
* dataType: "STRING",
* value: "*",
* },
* {
* name: "param2",
* description: "Description for param2",
* dataType: "STRING",
* value: "*",
* },
* ],
* schedule: {
* cronExpression: "0 0 * * * ? *",
* muteErrorEmails: false,
* notification: {
* emailSearchNotification: {
* includeCsvAttachment: false,
* includeHistogram: false,
* includeQuery: true,
* includeResultSet: true,
* subjectTemplate: "Search Alert: {{TriggerCondition}} found for {{SearchName}}",
* toLists: ["will@acme.com"],
* },
* },
* parseableTimeRange: {
* beginBoundedTimeRange: {
* from: {
* relativeTimeRange: {
* relativeTime: "-15m",
* },
* },
* },
* },
* scheduleType: "1Week",
* threshold: {
* count: 10,
* operator: "gt",
* thresholdType: "group",
* },
* timeZone: "America/Los_Angeles",
* parameters: [
* {
* name: "param1",
* value: "*",
* },
* {
* name: "param2",
* value: "*",
* },
* ],
* },
* });
* ```
*
* ## Attributes reference
*
* In addition to all arguments above, the following attributes are exported:
*
* - `id` - The ID of the log search.
*
* ## Import
*
* A log search can be imported using it's identifier, e.g.:
*
* hcl
*
* ```sh
* $ pulumi import sumologic:index/logSearch:LogSearch example_search 0000000007FFD79D
* ```
*/
class LogSearch extends pulumi.CustomResource {
/**
* Get an existing LogSearch resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new LogSearch(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of LogSearch. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === LogSearch.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["parentId"] = state ? state.parentId : undefined;
resourceInputs["parsingMode"] = state ? state.parsingMode : undefined;
resourceInputs["queryParameters"] = state ? state.queryParameters : undefined;
resourceInputs["queryString"] = state ? state.queryString : undefined;
resourceInputs["runByReceiptTime"] = state ? state.runByReceiptTime : undefined;
resourceInputs["schedule"] = state ? state.schedule : undefined;
resourceInputs["timeRange"] = state ? state.timeRange : undefined;
}
else {
const args = argsOrState;
if ((!args || args.parentId === undefined) && !opts.urn) {
throw new Error("Missing required property 'parentId'");
}
if ((!args || args.queryString === undefined) && !opts.urn) {
throw new Error("Missing required property 'queryString'");
}
if ((!args || args.timeRange === undefined) && !opts.urn) {
throw new Error("Missing required property 'timeRange'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["parentId"] = args ? args.parentId : undefined;
resourceInputs["parsingMode"] = args ? args.parsingMode : undefined;
resourceInputs["queryParameters"] = args ? args.queryParameters : undefined;
resourceInputs["queryString"] = args ? args.queryString : undefined;
resourceInputs["runByReceiptTime"] = args ? args.runByReceiptTime : undefined;
resourceInputs["schedule"] = args ? args.schedule : undefined;
resourceInputs["timeRange"] = args ? args.timeRange : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(LogSearch.__pulumiType, name, resourceInputs, opts);
}
}
exports.LogSearch = LogSearch;
/** @internal */
LogSearch.__pulumiType = 'sumologic:index/logSearch:LogSearch';
//# sourceMappingURL=logSearch.js.map