Skip to content

Commit a16d990

Browse files
authored
adjustments to confgenerator for Operator (#251)
* generate truncated config file for Operator * update confgenerator with generateStages flag and tags * updated doc * make GenerateConfig exported for use by NOO
1 parent 467e409 commit a16d990

22 files changed

+130
-38
lines changed

cmd/confgenerator/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func initConfig() {
6363
if err != nil {
6464
log.Fatal(err)
6565
}
66-
// Search config in home directory with name ".flpconfgen" (without extension).
66+
// Search config in home directory with name ".confgen" (without extension).
6767
v.AddConfigPath(home)
6868
v.SetConfigName(defaultLogFileName)
6969
}
@@ -132,7 +132,8 @@ func initFlags() {
132132
rootCmd.PersistentFlags().StringVar(&confgen.Opt.DestConfFile, "destConfFile", "/tmp/flowlogs-pipeline.conf.yaml", "destination configuration file")
133133
rootCmd.PersistentFlags().StringVar(&confgen.Opt.DestDocFile, "destDocFile", "/tmp/metrics.md", "destination documentation file (.md)")
134134
rootCmd.PersistentFlags().StringVar(&confgen.Opt.DestGrafanaJsonnetFolder, "destGrafanaJsonnetFolder", "/tmp/jsonnet", "destination grafana jsonnet folder")
135-
rootCmd.PersistentFlags().StringSliceVar(&confgen.Opt.SkipWithLabels, "skipWithLabels", nil, "Skip definitions with Labels")
135+
rootCmd.PersistentFlags().StringSliceVar(&confgen.Opt.SkipWithTags, "skipWithTags", nil, "Skip definitions with Tags")
136+
rootCmd.PersistentFlags().StringSliceVar(&confgen.Opt.GenerateStages, "generateStages", nil, "Produce only specified stages (ingest, transform_generic, transform_network, extract_aggregate, encode_prom, write_loki")
136137
}
137138

138139
func main() {

docs/confGenerator.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ Usage:
2121

2222
Flags:
2323
--config string config file (default is $HOME/.confgen)
24-
--destConfFile string destination configuration file (default "flowlogs-pipeline.conf.yaml")
25-
--destGrafanaJsonnetFolder string destination grafana jsonnet folder
24+
--destConfFile string destination configuration file (default "/tmp/flowlogs-pipeline.conf.yaml")
25+
--destDocFile string destination documentation file (.md) (default "/tmp/metrics.md")
26+
--destGrafanaJsonnetFolder string destination grafana jsonnet folder (default "/tmp/jsonnet")
27+
--generateStages strings Produce only specified stages (ingest, transform_generic, transform_network, extract_aggregate, encode_prom, write_loki
2628
-h, --help help for confgenerator
2729
--log-level string Log level: debug, info, warning, error (default "error")
28-
--skipWithLabels strings Skip definitions with Labels
30+
--skipWithTags strings Skip definitions with Tags
2931
--srcFolder string source folder (default "network_definitions")
30-
3132
```
3233
3334
> Note: confgenerator is available also from `netobserv/flowlogs-pipeline` quay image. To use execute:

network_definitions/bandwidth_per_network_service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ details:
55
Sum bytes for all traffic per network service
66
usage:
77
Evaluate network usage breakdown per network service
8-
labels:
8+
tags:
99
- bandwidth
1010
- graph
1111
- rate

network_definitions/bandwidth_per_src_dest_subnet.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ details:
55
Sum bandwidth bytes for all traffic per source / destination subnet pair
66
usage:
77
Evaluate network usage breakdown per source / destination subnet pair
8-
labels:
8+
tags:
99
- bandwidth
1010
- graph
1111
- rate

network_definitions/bandwidth_per_src_subnet.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ details:
55
Sum bytes for all traffic per source subnet
66
usage:
77
Evaluate network usage breakdown per source subnet
8-
labels:
8+
tags:
99
- bandwidth
1010
- graph
1111
- rate

network_definitions/connection_rate_per_dest_subnet.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ details:
55
Counts the number of connections per subnet with network prefix length /16 (using conn_tracking sum isNewFlow field)
66
usage:
77
Evaluate network connections per subnet
8-
labels:
8+
tags:
99
- rate
1010
- subnet
1111
transform:

network_definitions/connection_rate_per_src_subnet.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ details:
55
Counts the number of connections per subnet with network prefix length /16
66
usage:
77
Evaluate network connections per subnet
8-
labels:
8+
tags:
99
- rate
1010
- subnet
1111
transform:

network_definitions/connection_rate_per_tcp_flags.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ details:
55
Counts the number of connections per tcp flags
66
usage:
77
Evaluate difference in connections rate of different TCP Flags. Can be used, for example, to identify syn-attacks.
8-
labels:
8+
tags:
99
- rate
1010
- TCPFlags
1111
extract:

network_definitions/connections_per_dst_as.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ details:
55
Aggregates flow records by values of "DstAS" field and counts the number of entries in each aggregate with non zero value
66
usage:
77
Evaluate amount of connections targeted at different Autonomous Systems
8-
labels:
8+
tags:
99
- rate
1010
- count
1111
- AS

network_definitions/connections_per_src_as.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ details:
55
Aggregates flow records by values of "SrcAS" field and counts the number of entries in each aggregate with non zero value
66
usage:
77
Evaluate amount of connections initiated by different Autonomous Systems
8-
labels:
8+
tags:
99
- rate
1010
- count
1111
- AS

0 commit comments

Comments
 (0)