11package main
22
33/*
4- Copyright (c) IBM Corporation 2016, 2021
4+ Copyright (c) IBM Corporation 2016, 2022
55
66 Licensed under the Apache License, Version 2.0 (the "License");
77 you may not use this file except in compliance with the License.
@@ -25,10 +25,12 @@ import (
2525type mqTTYConfig struct {
2626 cf cf.Config
2727 interval string
28+ oneline bool
2829}
2930
3031type ConfigYJson struct {
3132 Interval string
33+ OneLine bool
3234}
3335
3436type mqExporterConfigYaml struct {
@@ -50,6 +52,7 @@ func initConfig() error {
5052 cf .InitConfig (& config .cf )
5153
5254 cf .AddParm (& config .interval , "10s" , cf .CP_STR , "ibmmq.interval" , "json" , "interval" , "How long between each collection" )
55+ cf .AddParm (& config .oneline , false , cf .CP_BOOL , "ibmmq.oneline" , "json" , "oneline" , "JSON output on a single line" )
5356
5457 err = cf .ParseParms ()
5558
@@ -59,6 +62,7 @@ func initConfig() error {
5962 if err == nil {
6063 cf .CopyYamlConfig (& config .cf , cfy .Global , cfy .Connection , cfy .Objects )
6164 config .interval = cf .CopyParmIfNotSetStr ("json" , "interval" , cfy .JSON .Interval )
65+ config .oneline = cf .CopyParmIfNotSetBool ("json" , "oneline" , cfy .JSON .OneLine )
6266 }
6367 }
6468 }
0 commit comments