diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 5008ddfc..00000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.gitignore b/.gitignore index dd2efc17..2fd7e779 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,5 @@ cmd/version/generated_version.go ## local configuration config.yaml + +.DS_Store diff --git a/pkg/cat/jchf.go b/pkg/cat/jchf.go index a81ca486..d4e3b387 100644 --- a/pkg/cat/jchf.go +++ b/pkg/cat/jchf.go @@ -18,6 +18,8 @@ import ( var ( DEFAULT_GEO = []byte("--") DEFAULT_GEO_PACKED = patricia.PackGeo(DEFAULT_GEO) + + defaultProvider = kt.ProviderFlowDevice ) func (kc *KTranslate) getEventType(dst *kt.JCHF) string { @@ -47,12 +49,12 @@ func (kc *KTranslate) getProviderType(dst *kt.JCHF) kt.Provider { udr, ok := dst.CustomStr[UDR_TYPE] if !ok { // Return this right away. - return kt.ProviderFlowDevice + return defaultProvider } // Or maybe its a host. if udr == "kprobe" || udr == "kappa" { - return kt.ProviderFlowDevice + return defaultProvider } // Else, if its synth, return this. @@ -66,7 +68,7 @@ func (kc *KTranslate) getProviderType(dst *kt.JCHF) kt.Provider { } // Default to provider. - return kt.ProviderFlowDevice + return defaultProvider } func (kc *KTranslate) flowToJCHF(ctx context.Context, dst *kt.JCHF, src *Flow, currentTS int64, tagcache map[uint64]string) error { diff --git a/pkg/cat/kkc.go b/pkg/cat/kkc.go index b640a8ff..7d95f946 100644 --- a/pkg/cat/kkc.go +++ b/pkg/cat/kkc.go @@ -216,6 +216,12 @@ func NewKTranslate(config *ktranslate.Config, log logger.ContextL, registry go_m kc.objmgr = s3mgr } + // If the default provider env var is set, pass this into the system. + dp := kt.LookupEnvString("KENTIK_DEFAULT_PROVIDER_TYPE", "") + if dp != "" { + defaultProvider = kt.Provider(dp) + } + return kc, nil }