Skip to content

Commit e9bf651

Browse files
committed
oracle log analytics plugin
1 parent da22f5e commit e9bf651

File tree

8 files changed

+958
-1
lines changed

8 files changed

+958
-1
lines changed

apis/fluentbit/v1alpha2/clusteroutput_types.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ type OutputSpec struct {
100100
S3 *output.S3 `json:"s3,omitempty"`
101101
// Gelf defines GELF Output configuration.
102102
Gelf *output.Gelf `json:"gelf,omitempty"`
103-
103+
// OracleLogAnalytics defines OracleLogAnalytics Output configuration
104+
OracleLogAnalytics *output.OracleLogAnalytics `json:"oracleLogAnalytics,omitempty"`
104105
// CustomPlugin defines Custom Output configuration.
105106
CustomPlugin *custom.CustomPlugin `json:"customPlugin,omitempty"`
106107
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
package output
2+
3+
import (
4+
"fmt"
5+
"github.com/fluent/fluent-operator/v2/apis/fluentbit/v1alpha2/plugins"
6+
"github.com/fluent/fluent-operator/v2/apis/fluentbit/v1alpha2/plugins/params"
7+
)
8+
9+
// +kubebuilder:object:generate:=true
10+
11+
type OracleLogAnalytics struct {
12+
Auth *AuthConfig `json:"auth,omitempty"`
13+
OCIConfigInRecord bool `json:"ociConfigInRecord,omitempty"`
14+
ObjectStorageNamespace *string `json:"objectStorageNamespace,omitempty"`
15+
ProfileName *string `json:"profileName,omitempty"`
16+
LogGroupId *string `json:"logGroupId,omitempty"`
17+
LogSourceName *string `json:"logSourceName,omitempty"`
18+
LogEntityId *string `json:"logEntityId,omitempty"`
19+
LogEntityType *string `json:"logEntityType,omitempty"`
20+
LogPath *string `json:"logPath,omitempty"`
21+
LogSet *string `json:"logSetId,omitempty"`
22+
GlobalMetadata map[string]string `json:"globalMetadata,omitempty"`
23+
LogEventMetadata map[string]string `json:"logEventMetadata,omitempty"`
24+
Workers *int32 `json:"Workers,omitempty"`
25+
*plugins.TLS `json:"tls,omitempty"`
26+
}
27+
28+
// +kubebuilder:object:generate:=true
29+
30+
type AuthConfig struct {
31+
ConfigFileLocation *string `json:"configFileLocation,omitempty"`
32+
ProfileName *string `json:"profileName,omitempty"`
33+
}
34+
35+
func (_ *OracleLogAnalytics) Name() string {
36+
return "oracle_log_analytics"
37+
}
38+
39+
func (o *OracleLogAnalytics) Params(sl plugins.SecretLoader) (*params.KVs, error) {
40+
kvs := params.NewKVs()
41+
if o.Auth.ConfigFileLocation != nil {
42+
kvs.Insert("config_file_location", *o.Auth.ConfigFileLocation)
43+
}
44+
if o.Auth.ProfileName != nil {
45+
kvs.Insert("profile_name", *o.Auth.ProfileName)
46+
}
47+
if o.ObjectStorageNamespace != nil {
48+
kvs.Insert("namespace", *o.ObjectStorageNamespace)
49+
}
50+
if o.OCIConfigInRecord {
51+
kvs.Insert("oci_config_in_record", "true")
52+
}
53+
if o.LogGroupId != nil {
54+
kvs.Insert("oci_la_log_group_id", *o.LogGroupId)
55+
}
56+
if o.LogSourceName != nil {
57+
kvs.Insert("oci_la_log_source_name", *o.LogSourceName)
58+
}
59+
if o.LogEntityId != nil {
60+
kvs.Insert("oci_la_log_entity_id", *o.LogEntityId)
61+
}
62+
if o.LogEntityType != nil {
63+
kvs.Insert("oci_la_log_entity_type", *o.LogEntityType)
64+
}
65+
if o.LogPath != nil {
66+
kvs.Insert("oci_la_log_path", *o.LogPath)
67+
}
68+
if o.LogSet != nil {
69+
kvs.Insert("oci_la_log_set_id", *o.LogSet)
70+
}
71+
if o.GlobalMetadata != nil {
72+
for k, v := range o.GlobalMetadata {
73+
kvs.Insert("oci_la_global_metadata", fmt.Sprintf("%s %s", k, v))
74+
}
75+
}
76+
if o.LogEventMetadata != nil {
77+
for k, v := range o.LogEventMetadata {
78+
kvs.Insert("oci_la_metadata", fmt.Sprintf("%s %s", k, v))
79+
}
80+
}
81+
if o.Workers != nil {
82+
kvs.Insert("Workers", fmt.Sprint(*o.Workers))
83+
}
84+
if o.TLS != nil {
85+
tls, err := o.TLS.Params(sl)
86+
if err != nil {
87+
return nil, err
88+
}
89+
kvs.Merge(tls)
90+
}
91+
return kvs, nil
92+
}

charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusteroutputs.yaml

+108
Original file line numberDiff line numberDiff line change
@@ -2230,6 +2230,114 @@ spec:
22302230
server listening for traces, e.g: /v1/traces'
22312231
type: string
22322232
type: object
2233+
oracleLogAnalytics:
2234+
description: OracleLogAnalytics defines OracleLogAnalytics Output
2235+
configuration
2236+
properties:
2237+
Workers:
2238+
format: int32
2239+
type: integer
2240+
auth:
2241+
properties:
2242+
configFileLocation:
2243+
type: string
2244+
profileName:
2245+
type: string
2246+
type: object
2247+
globalMetadata:
2248+
additionalProperties:
2249+
type: string
2250+
type: object
2251+
logEntityId:
2252+
type: string
2253+
logEntityType:
2254+
type: string
2255+
logEventMetadata:
2256+
additionalProperties:
2257+
type: string
2258+
type: object
2259+
logGroupId:
2260+
type: string
2261+
logPath:
2262+
type: string
2263+
logSetId:
2264+
type: string
2265+
logSourceName:
2266+
type: string
2267+
objectStorageNamespace:
2268+
type: string
2269+
ociConfigInRecord:
2270+
type: boolean
2271+
profileName:
2272+
type: string
2273+
tls:
2274+
description: Fluent Bit provides integrated support for Transport
2275+
Layer Security (TLS) and it predecessor Secure Sockets Layer
2276+
(SSL) respectively.
2277+
properties:
2278+
caFile:
2279+
description: Absolute path to CA certificate file
2280+
type: string
2281+
caPath:
2282+
description: Absolute path to scan for certificate files
2283+
type: string
2284+
crtFile:
2285+
description: Absolute path to Certificate file
2286+
type: string
2287+
debug:
2288+
description: 'Set TLS debug verbosity level. It accept the
2289+
following values: 0 (No debug), 1 (Error), 2 (State change),
2290+
3 (Informational) and 4 Verbose'
2291+
enum:
2292+
- 0
2293+
- 1
2294+
- 2
2295+
- 3
2296+
- 4
2297+
format: int32
2298+
type: integer
2299+
keyFile:
2300+
description: Absolute path to private Key file
2301+
type: string
2302+
keyPassword:
2303+
description: Optional password for tls.key_file file
2304+
properties:
2305+
valueFrom:
2306+
description: ValueSource defines how to find a value's
2307+
key.
2308+
properties:
2309+
secretKeyRef:
2310+
description: Selects a key of a secret in the pod's
2311+
namespace
2312+
properties:
2313+
key:
2314+
description: The key of the secret to select from. Must
2315+
be a valid secret key.
2316+
type: string
2317+
name:
2318+
description: 'Name of the referent. More info:
2319+
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
2320+
TODO: Add other useful fields. apiVersion, kind,
2321+
uid?'
2322+
type: string
2323+
optional:
2324+
description: Specify whether the Secret or its
2325+
key must be defined
2326+
type: boolean
2327+
required:
2328+
- key
2329+
type: object
2330+
x-kubernetes-map-type: atomic
2331+
type: object
2332+
type: object
2333+
verify:
2334+
description: Force certificate validation
2335+
type: boolean
2336+
vhost:
2337+
description: Hostname to be used for TLS SNI extension
2338+
type: string
2339+
type: object
2340+
type: object
22332341
prometheusExporter:
22342342
description: PrometheusExporter_types defines Prometheus exporter
22352343
configuration to expose metrics from Fluent Bit.

charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_outputs.yaml

+108
Original file line numberDiff line numberDiff line change
@@ -2230,6 +2230,114 @@ spec:
22302230
server listening for traces, e.g: /v1/traces'
22312231
type: string
22322232
type: object
2233+
oracleLogAnalytics:
2234+
description: OracleLogAnalytics defines OracleLogAnalytics Output
2235+
configuration
2236+
properties:
2237+
Workers:
2238+
format: int32
2239+
type: integer
2240+
auth:
2241+
properties:
2242+
configFileLocation:
2243+
type: string
2244+
profileName:
2245+
type: string
2246+
type: object
2247+
globalMetadata:
2248+
additionalProperties:
2249+
type: string
2250+
type: object
2251+
logEntityId:
2252+
type: string
2253+
logEntityType:
2254+
type: string
2255+
logEventMetadata:
2256+
additionalProperties:
2257+
type: string
2258+
type: object
2259+
logGroupId:
2260+
type: string
2261+
logPath:
2262+
type: string
2263+
logSetId:
2264+
type: string
2265+
logSourceName:
2266+
type: string
2267+
objectStorageNamespace:
2268+
type: string
2269+
ociConfigInRecord:
2270+
type: boolean
2271+
profileName:
2272+
type: string
2273+
tls:
2274+
description: Fluent Bit provides integrated support for Transport
2275+
Layer Security (TLS) and it predecessor Secure Sockets Layer
2276+
(SSL) respectively.
2277+
properties:
2278+
caFile:
2279+
description: Absolute path to CA certificate file
2280+
type: string
2281+
caPath:
2282+
description: Absolute path to scan for certificate files
2283+
type: string
2284+
crtFile:
2285+
description: Absolute path to Certificate file
2286+
type: string
2287+
debug:
2288+
description: 'Set TLS debug verbosity level. It accept the
2289+
following values: 0 (No debug), 1 (Error), 2 (State change),
2290+
3 (Informational) and 4 Verbose'
2291+
enum:
2292+
- 0
2293+
- 1
2294+
- 2
2295+
- 3
2296+
- 4
2297+
format: int32
2298+
type: integer
2299+
keyFile:
2300+
description: Absolute path to private Key file
2301+
type: string
2302+
keyPassword:
2303+
description: Optional password for tls.key_file file
2304+
properties:
2305+
valueFrom:
2306+
description: ValueSource defines how to find a value's
2307+
key.
2308+
properties:
2309+
secretKeyRef:
2310+
description: Selects a key of a secret in the pod's
2311+
namespace
2312+
properties:
2313+
key:
2314+
description: The key of the secret to select from. Must
2315+
be a valid secret key.
2316+
type: string
2317+
name:
2318+
description: 'Name of the referent. More info:
2319+
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
2320+
TODO: Add other useful fields. apiVersion, kind,
2321+
uid?'
2322+
type: string
2323+
optional:
2324+
description: Specify whether the Secret or its
2325+
key must be defined
2326+
type: boolean
2327+
required:
2328+
- key
2329+
type: object
2330+
x-kubernetes-map-type: atomic
2331+
type: object
2332+
type: object
2333+
verify:
2334+
description: Force certificate validation
2335+
type: boolean
2336+
vhost:
2337+
description: Hostname to be used for TLS SNI extension
2338+
type: string
2339+
type: object
2340+
type: object
22332341
prometheusExporter:
22342342
description: PrometheusExporter_types defines Prometheus exporter
22352343
configuration to expose metrics from Fluent Bit.

0 commit comments

Comments
 (0)