@luminati-io/kubernetes-models-fluent-operator
Version:
Models for https://github.com/fluent/fluent-operator
599 lines (598 loc) • 28.8 kB
TypeScript
import { IObjectMeta } from "@kubernetes-models/apimachinery/apis/meta/v1/ObjectMeta";
import { Model, ModelData } from "@kubernetes-models/base";
/**
* Filter is the Schema for namespace level filter API
*/
export interface IFilter {
/**
* APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
*/
"apiVersion": "fluentbit.fluent.io/v1alpha2";
/**
* Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
*/
"kind": "Filter";
"metadata"?: IObjectMeta;
/**
* FilterSpec defines the desired state of ClusterFilter
*/
"spec"?: {
/**
* A set of filter plugins in order.
*/
"filters"?: Array<{
/**
* Aws defines a Aws configuration.
*/
"aws"?: {
/**
* The account ID for current EC2 instance.Default is false.
*/
"accountID"?: boolean;
/**
* Alias for the plugin
*/
"alias"?: string;
/**
* The EC2 instance image id.Default is false.
*/
"amiID"?: boolean;
/**
* The availability zone; for example, "us-east-1a". Default is true.
*/
"az"?: boolean;
/**
* The EC2 instance ID.Default is true.
*/
"ec2InstanceID"?: boolean;
/**
* The EC2 instance type.Default is false.
*/
"ec2InstanceType"?: boolean;
/**
* The hostname for current EC2 instance.Default is false.
*/
"hostName"?: boolean;
/**
* Specify which version of the instance metadata service to use. Valid values are 'v1' or 'v2'.
*/
"imdsVersion"?: "v1" | "v2";
/**
* The EC2 instance private ip.Default is false.
*/
"privateIP"?: boolean;
/**
* RetryLimit describes how many times fluent-bit should retry to send data to a specific output. If set to false fluent-bit will try indefinetly. If set to any integer N>0 it will try at most N+1 times. Leading zeros are not allowed (values such as 007, 0150, 01 do not work). If this property is not defined fluent-bit will use the default value: 1.
*/
"retryLimit"?: string;
/**
* The VPC ID for current EC2 instance.Default is false.
*/
"vpcID"?: boolean;
};
/**
* CustomPlugin defines a Custom plugin configuration.
*/
"customPlugin"?: {
"config"?: string;
};
/**
* Grep defines Grep Filter configuration.
*/
"grep"?: {
/**
* Alias for the plugin
*/
"alias"?: string;
/**
* Exclude records which field matches the regular expression. Value Format: FIELD REGEX
*/
"exclude"?: string;
/**
* Keep records which field matches the regular expression. Value Format: FIELD REGEX
*/
"regex"?: string;
/**
* RetryLimit describes how many times fluent-bit should retry to send data to a specific output. If set to false fluent-bit will try indefinetly. If set to any integer N>0 it will try at most N+1 times. Leading zeros are not allowed (values such as 007, 0150, 01 do not work). If this property is not defined fluent-bit will use the default value: 1.
*/
"retryLimit"?: string;
};
/**
* Kubernetes defines Kubernetes Filter configuration.
*/
"kubernetes"?: {
/**
* Alias for the plugin
*/
"alias"?: string;
/**
* Include Kubernetes resource annotations in the extra metadata.
*/
"annotations"?: boolean;
/**
* Set the buffer size for HTTP client when reading responses from Kubernetes API server.
*/
"bufferSize"?: string;
/**
* When enabled, metadata will be fetched from K8s when docker_id is changed.
*/
"cacheUseDockerId"?: boolean;
/**
* DNS lookup retries N times until the network start working
*/
"dnsRetries"?: number;
/**
* DNS lookup interval between network status checks
*/
"dnsWaitTime"?: number;
/**
* If set, use dummy-meta data (for test/dev purposes)
*/
"dummyMeta"?: boolean;
/**
* Allow Kubernetes Pods to exclude their logs from the log processor (read more about it in Kubernetes Annotations section).
*/
"k8sLoggingExclude"?: boolean;
/**
* Allow Kubernetes Pods to suggest a pre-defined Parser (read more about it in Kubernetes Annotations section)
*/
"k8sLoggingParser"?: boolean;
/**
* When Keep_Log is disabled, the log field is removed from the incoming message once it has been successfully merged (Merge_Log must be enabled as well).
*/
"keepLog"?: boolean;
/**
* CA certificate file
*/
"kubeCAFile"?: string;
/**
* Absolute path to scan for certificate files
*/
"kubeCAPath"?: string;
/**
* configurable TTL for K8s cached metadata. By default, it is set to 0 which means TTL for cache entries is disabled and cache entries are evicted at random when capacity is reached. In order to enable this option, you should set the number to a time interval. For example, set this value to 60 or 60s and cache entries which have been created more than 60s will be evicted.
*/
"kubeMetaCacheTTL"?: string;
/**
* If set, Kubernetes meta-data can be cached/pre-loaded from files in JSON format in this directory, named as namespace-pod.meta
*/
"kubeMetaPreloadCacheDir"?: string;
/**
* When the source records comes from Tail input plugin, this option allows to specify what's the prefix used in Tail configuration.
*/
"kubeTagPrefix"?: string;
/**
* Token file
*/
"kubeTokenFile"?: string;
/**
* configurable 'time to live' for the K8s token. By default, it is set to 600 seconds. After this time, the token is reloaded from Kube_Token_File or the Kube_Token_Command.
*/
"kubeTokenTTL"?: string;
/**
* API Server end-point
*/
"kubeURL"?: string;
/**
* kubelet host using for HTTP request, this only works when Use_Kubelet set to On.
*/
"kubeletHost"?: string;
/**
* kubelet port using for HTTP request, this only works when useKubelet is set to On.
*/
"kubeletPort"?: number;
/**
* Include Kubernetes resource labels in the extra metadata.
*/
"labels"?: boolean;
/**
* When enabled, it checks if the log field content is a JSON string map, if so, it append the map fields as part of the log structure.
*/
"mergeLog"?: boolean;
/**
* When Merge_Log is enabled, the filter tries to assume the log field from the incoming message is a JSON string message and make a structured representation of it at the same level of the log field in the map. Now if Merge_Log_Key is set (a string name), all the new structured fields taken from the original log content are inserted under the new key.
*/
"mergeLogKey"?: string;
/**
* When Merge_Log is enabled, trim (remove possible \n or \r) field values.
*/
"mergeLogTrim"?: boolean;
/**
* Optional parser name to specify how to parse the data contained in the log key. Recommended use is for developers or testing only.
*/
"mergeParser"?: string;
/**
* Set an alternative Parser to process record Tag and extract pod_name, namespace_name, container_name and docker_id. The parser must be registered in a parsers file (refer to parser filter-kube-test as an example).
*/
"regexParser"?: string;
/**
* RetryLimit describes how many times fluent-bit should retry to send data to a specific output. If set to false fluent-bit will try indefinetly. If set to any integer N>0 it will try at most N+1 times. Leading zeros are not allowed (values such as 007, 0150, 01 do not work). If this property is not defined fluent-bit will use the default value: 1.
*/
"retryLimit"?: string;
/**
* Debug level between 0 (nothing) and 4 (every detail).
*/
"tlsDebug"?: number;
/**
* When enabled, turns on certificate validation when connecting to the Kubernetes API server.
*/
"tlsVerify"?: boolean;
/**
* When enabled, the filter reads logs coming in Journald format.
*/
"useJournal"?: boolean;
/**
* This is an optional feature flag to get metadata information from kubelet instead of calling Kube Server API to enhance the log. This could mitigate the Kube API heavy traffic issue for large cluster.
*/
"useKubelet"?: boolean;
};
/**
* Lua defines Lua Filter configuration.
*/
"lua"?: {
/**
* Alias for the plugin
*/
"alias"?: string;
/**
* Lua function name that will be triggered to do filtering. It's assumed that the function is declared inside the Script defined above.
*/
"call": string;
/**
* If enabled, Lua script will be executed in protected mode. It prevents to crash when invalid Lua script is executed. Default is true.
*/
"protectedMode"?: boolean;
/**
* RetryLimit describes how many times fluent-bit should retry to send data to a specific output. If set to false fluent-bit will try indefinetly. If set to any integer N>0 it will try at most N+1 times. Leading zeros are not allowed (values such as 007, 0150, 01 do not work). If this property is not defined fluent-bit will use the default value: 1.
*/
"retryLimit"?: string;
/**
* Path to the Lua script that will be used.
*/
"script": {
/**
* The key to select.
*/
"key": string;
/**
* Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
*/
"name"?: string;
/**
* Specify whether the ConfigMap or its key must be defined
*/
"optional"?: boolean;
};
/**
* By default when the Lua script is invoked, the record timestamp is passed as a Floating number which might lead to loss precision when the data is converted back. If you desire timestamp precision enabling this option will pass the timestamp as a Lua table with keys sec for seconds since epoch and nsec for nanoseconds.
*/
"timeAsTable"?: boolean;
/**
* If these keys are matched, the fields are converted to integer. If more than one key, delimit by space. Note that starting from Fluent Bit v1.6 integer data types are preserved and not converted to double as in previous versions.
*/
"typeIntKey"?: Array<string>;
};
/**
* Modify defines Modify Filter configuration.
*/
"modify"?: {
/**
* Alias for the plugin
*/
"alias"?: string;
/**
* All conditions have to be true for the rules to be applied.
*/
"conditions"?: Array<{
/**
* Is true if a key matches regex KEY
*/
"aKeyMatches"?: string;
/**
* Is true if KEY does not exist
*/
"keyDoesNotExist"?: {
[key: string]: string;
};
/**
* Is true if KEY exists
*/
"keyExists"?: string;
/**
* Is true if KEY exists and its value is not VALUE
*/
"keyValueDoesNotEqual"?: {
[key: string]: string;
};
/**
* Is true if key KEY exists and its value does not match VALUE
*/
"keyValueDoesNotMatch"?: {
[key: string]: string;
};
/**
* Is true if KEY exists and its value is VALUE
*/
"keyValueEquals"?: {
[key: string]: string;
};
/**
* Is true if key KEY exists and its value matches VALUE
*/
"keyValueMatches"?: {
[key: string]: string;
};
/**
* Is true if all keys matching KEY have values that do not match VALUE
*/
"matchingKeysDoNotHaveMatchingValues"?: {
[key: string]: string;
};
/**
* Is true if all keys matching KEY have values that match VALUE
*/
"matchingKeysHaveMatchingValues"?: {
[key: string]: string;
};
/**
* Is true if no key matches regex KEY
*/
"noKeyMatches"?: string;
}>;
/**
* RetryLimit describes how many times fluent-bit should retry to send data to a specific output. If set to false fluent-bit will try indefinetly. If set to any integer N>0 it will try at most N+1 times. Leading zeros are not allowed (values such as 007, 0150, 01 do not work). If this property is not defined fluent-bit will use the default value: 1.
*/
"retryLimit"?: string;
/**
* Rules are applied in the order they appear, with each rule operating on the result of the previous rule.
*/
"rules"?: Array<{
/**
* Add a key/value pair with key KEY and value VALUE if KEY does not exist
*/
"add"?: {
[key: string]: string;
};
/**
* Copy a key/value pair with key KEY to COPIED_KEY if KEY exists AND COPIED_KEY does not exist
*/
"copy"?: {
[key: string]: string;
};
/**
* Copy a key/value pair with key KEY to COPIED_KEY if KEY exists. If COPIED_KEY already exists, this field is overwritten
*/
"hardCopy"?: {
[key: string]: string;
};
/**
* Rename a key/value pair with key KEY to RENAMED_KEY if KEY exists. If RENAMED_KEY already exists, this field is overwritten
*/
"hardRename"?: {
[key: string]: string;
};
/**
* Remove a key/value pair with key KEY if it exists
*/
"remove"?: string;
/**
* Remove all key/value pairs with key matching regexp KEY
*/
"removeRegex"?: string;
/**
* Remove all key/value pairs with key matching wildcard KEY
*/
"removeWildcard"?: string;
/**
* Rename a key/value pair with key KEY to RENAMED_KEY if KEY exists AND RENAMED_KEY does not exist
*/
"rename"?: {
[key: string]: string;
};
/**
* Add a key/value pair with key KEY and value VALUE. If KEY already exists, this field is overwritten
*/
"set"?: {
[key: string]: string;
};
}>;
};
/**
* Multiline defines a Multiline configuration.
*/
"multiline"?: {
/**
* Alias for the plugin
*/
"alias"?: string;
/**
* Key name that holds the content to process. Note that a Multiline Parser definition can already specify the key_content to use, but this option allows to overwrite that value for the purpose of the filter.
*/
"keyContent"?: string;
/**
* Specify one or multiple Multiline Parsing definitions to apply to the content. You can specify multiple multiline parsers to detect different formats by separating them with a comma.
*/
"parser": string;
/**
* RetryLimit describes how many times fluent-bit should retry to send data to a specific output. If set to false fluent-bit will try indefinetly. If set to any integer N>0 it will try at most N+1 times. Leading zeros are not allowed (values such as 007, 0150, 01 do not work). If this property is not defined fluent-bit will use the default value: 1.
*/
"retryLimit"?: string;
};
/**
* Nest defines Nest Filter configuration.
*/
"nest"?: {
/**
* Prefix affected keys with this string
*/
"addPrefix"?: string;
/**
* Alias for the plugin
*/
"alias"?: string;
/**
* Nest records matching the Wildcard under this key
*/
"nestUnder"?: string;
/**
* Lift records nested under the Nested_under key
*/
"nestedUnder"?: string;
/**
* Select the operation nest or lift
*/
"operation"?: "nest" | "lift";
/**
* Remove prefix from affected keys if it matches this string
*/
"removePrefix"?: string;
/**
* RetryLimit describes how many times fluent-bit should retry to send data to a specific output. If set to false fluent-bit will try indefinetly. If set to any integer N>0 it will try at most N+1 times. Leading zeros are not allowed (values such as 007, 0150, 01 do not work). If this property is not defined fluent-bit will use the default value: 1.
*/
"retryLimit"?: string;
/**
* Nest records which field matches the wildcard
*/
"wildcard"?: Array<string>;
};
/**
* Parser defines Parser Filter configuration.
*/
"parser"?: {
/**
* Alias for the plugin
*/
"alias"?: string;
/**
* Specify field name in record to parse.
*/
"keyName"?: string;
/**
* Specify the parser name to interpret the field. Multiple Parser entries are allowed (split by comma).
*/
"parser"?: string;
/**
* Keep original Key_Name field in the parsed result. If false, the field will be removed.
*/
"preserveKey"?: boolean;
/**
* Keep all other original fields in the parsed result. If false, all other original fields will be removed.
*/
"reserveData"?: boolean;
/**
* RetryLimit describes how many times fluent-bit should retry to send data to a specific output. If set to false fluent-bit will try indefinetly. If set to any integer N>0 it will try at most N+1 times. Leading zeros are not allowed (values such as 007, 0150, 01 do not work). If this property is not defined fluent-bit will use the default value: 1.
*/
"retryLimit"?: string;
/**
* If the key is a escaped string (e.g: stringify JSON), unescape the string before to apply the parser.
*/
"unescapeKey"?: boolean;
};
/**
* RecordModifier defines Record Modifier Filter configuration.
*/
"recordModifier"?: {
/**
* Alias for the plugin
*/
"alias"?: string;
/**
* If the key is not matched, that field is removed.
*/
"allowlistKeys"?: Array<string>;
/**
* Append fields. This parameter needs key and value pair.
*/
"records"?: Array<string>;
/**
* If the key is matched, that field is removed.
*/
"removeKeys"?: Array<string>;
/**
* RetryLimit describes how many times fluent-bit should retry to send data to a specific output. If set to false fluent-bit will try indefinetly. If set to any integer N>0 it will try at most N+1 times. Leading zeros are not allowed (values such as 007, 0150, 01 do not work). If this property is not defined fluent-bit will use the default value: 1.
*/
"retryLimit"?: string;
/**
* If set, the plugin appends uuid to each record. The value assigned becomes the key in the map.
*/
"uuidKeys"?: Array<string>;
/**
* An alias of allowlistKeys for backwards compatibility.
*/
"whitelistKeys"?: Array<string>;
};
/**
* RewriteTag defines a RewriteTag configuration.
*/
"rewriteTag"?: {
/**
* Alias for the plugin
*/
"alias"?: string;
/**
* When the filter emits a record under the new Tag, there is an internal emitter plugin that takes care of the job. Since this emitter expose metrics as any other component of the pipeline, you can use this property to configure an optional name for it.
*/
"emitterName"?: string;
/**
* RetryLimit describes how many times fluent-bit should retry to send data to a specific output. If set to false fluent-bit will try indefinetly. If set to any integer N>0 it will try at most N+1 times. Leading zeros are not allowed (values such as 007, 0150, 01 do not work). If this property is not defined fluent-bit will use the default value: 1.
*/
"retryLimit"?: string;
/**
* Defines the matching criteria and the format of the Tag for the matching record. The Rule format have four components: KEY REGEX NEW_TAG KEEP.
*/
"rules"?: Array<string>;
};
/**
* Throttle defines a Throttle configuration.
*/
"throttle"?: {
/**
* Alias for the plugin
*/
"alias"?: string;
/**
* Interval is the time interval expressed in "sleep" format. e.g. 3s, 1.5m, 0.5h, etc.
*/
"interval"?: string;
/**
* PrintStatus represents whether to print status messages with current rate and the limits to information logs.
*/
"printStatus"?: boolean;
/**
* Rate is the amount of messages for the time.
*/
"rate"?: number;
/**
* RetryLimit describes how many times fluent-bit should retry to send data to a specific output. If set to false fluent-bit will try indefinetly. If set to any integer N>0 it will try at most N+1 times. Leading zeros are not allowed (values such as 007, 0150, 01 do not work). If this property is not defined fluent-bit will use the default value: 1.
*/
"retryLimit"?: string;
/**
* Window is the amount of intervals to calculate average over.
*/
"window"?: number;
};
}>;
"logLevel"?: "off" | "error" | "warning" | "info" | "debug" | "trace";
/**
* A pattern to match against the tags of incoming records. It's case-sensitive and support the star (\*) character as a wildcard.
*/
"match"?: string;
/**
* A regular expression to match against the tags of incoming records. Use this option if you want to use the full regex syntax.
*/
"matchRegex"?: string;
};
}
/**
* Filter is the Schema for namespace level filter API
*/
export declare class Filter extends Model<IFilter> implements IFilter {
"apiVersion": IFilter["apiVersion"];
"kind": IFilter["kind"];
"metadata"?: IFilter["metadata"];
"spec"?: IFilter["spec"];
static apiVersion: IFilter["apiVersion"];
static kind: IFilter["kind"];
static is: import("@kubernetes-models/base").TypeMetaGuard<IFilter>;
constructor(data?: ModelData<IFilter>);
}