Initialize the object
(self, config_file="", log_level=None)
| 55 | ) |
| 56 | |
| 57 | def __init__(self, config_file="", log_level=None): |
| 58 | """ |
| 59 | Initialize the object |
| 60 | """ |
| 61 | |
| 62 | self._logger = self._log() |
| 63 | if log_level is not None: |
| 64 | self._logger.setLevel(log_level) |
| 65 | |
| 66 | if config_file != "": |
| 67 | self.splunk_config_file = config_file |
| 68 | |
| 69 | config = configparser.ConfigParser() |
| 70 | config_file = config.read(self.splunk_config_file) |
| 71 | if len(config_file) == 0: |
| 72 | self._logger.error("Error: Could not find the config file") |
| 73 | exit(1) |
| 74 | |
| 75 | self._init_splunk_connection(config) |
| 76 | |
| 77 | def get_splunk_client(self): |
| 78 | """ |
nothing calls this directly
no test coverage detected