Class initialization
(self, log_level=None)
| 85 | self.HEADERS = {"Authorization": "Splunk {}".format(self.ACCESS_TOKEN)} |
| 86 | |
| 87 | def __init__(self, log_level=None): |
| 88 | """ |
| 89 | Class initialization |
| 90 | """ |
| 91 | self._logger = self._log() |
| 92 | if log_level is not None: |
| 93 | self._logger.setLevel(log_level) |
| 94 | |
| 95 | config = configparser.ConfigParser() |
| 96 | config_file = config.read(self.splunk_config_file) |
| 97 | if len(config_file) == 0: |
| 98 | self._logger.error("Error: Could not find the config file") |
| 99 | exit(1) |
| 100 | |
| 101 | self._init_splunk_hec_connection(config) |
| 102 | |
| 103 | def push_to_splunk_hec( |
| 104 | self, source, message, endpoint=HECEndpoint.EVENT, level=HECLogLevel.INFO |
nothing calls this directly
no test coverage detected