├── .abapgit.xml ├── .github ├── dependabot.yml ├── release-drafter.yml └── workflows │ ├── release-drafter.yml │ └── update-changelog.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── abaplint.json ├── architecture └── architecture.planuml ├── docs ├── logo-abap-log-exporter-horizontal.png └── logo-abap-log-exporter.png ├── local-tests ├── README.md ├── docker-compose-fluentd.yml ├── docker-compose-grafana-loki.yml ├── docker-compose-graylog.yml ├── docker-compose-graylog4.yml ├── fluentd │ └── conf │ │ └── fluent.conf ├── grafana │ └── provisioning │ │ └── datasources │ │ └── loki.yml └── graylog │ └── plugin │ └── graylog-plugin-integrations-3.3.5.jar ├── out └── architecture │ └── architecture │ └── architecture.png ├── package-lock.json ├── package.json └── src ├── package.devc.xml ├── zale_connector ├── package.devc.xml ├── zcl_ale_log_connector_gelf.clas.abap ├── zcl_ale_log_connector_gelf.clas.xml ├── zcl_ale_log_connector_loki.clas.abap ├── zcl_ale_log_connector_loki.clas.xml ├── zif_ale_log_connector.intf.abap └── zif_ale_log_connector.intf.xml ├── zale_converter ├── package.devc.xml ├── zcl_ale_log_converter_gelf.clas.abap ├── zcl_ale_log_converter_gelf.clas.xml ├── zcl_ale_log_converter_loki.clas.abap ├── zcl_ale_log_converter_loki.clas.xml ├── zif_ale_log_converter.intf.abap └── zif_ale_log_converter.intf.xml ├── zale_customizing ├── package.devc.xml ├── zale_config.tabl.xml ├── zale_config.tran.xml ├── zale_config_mp.fugr.lzale_config_mpf00.abap ├── zale_config_mp.fugr.lzale_config_mpf00.xml ├── zale_config_mp.fugr.lzale_config_mpi00.abap ├── zale_config_mp.fugr.lzale_config_mpi00.xml ├── zale_config_mp.fugr.lzale_config_mpt00.abap ├── zale_config_mp.fugr.lzale_config_mpt00.xml ├── zale_config_mp.fugr.lzale_config_mptop.abap ├── zale_config_mp.fugr.lzale_config_mptop.xml ├── zale_config_mp.fugr.saplzale_config_mp.abap ├── zale_config_mp.fugr.saplzale_config_mp.xml ├── zale_config_mp.fugr.tableframe_zale_config_mp.abap ├── zale_config_mp.fugr.tableproc_zale_config_mp.abap ├── zale_config_mp.fugr.xml ├── zale_configs.tobj.xml ├── zale_connector_class.dtel.xml ├── zale_connector_url.doma.xml ├── zale_connector_url.dtel.xml ├── zale_converter_class.dtel.xml ├── zale_log_scenario.doma.xml ├── zale_log_scenario.dtel.xml ├── zale_reader_class.dtel.xml ├── zcl_ale_customizing.clas.abap ├── zcl_ale_customizing.clas.xml ├── zcl_ale_customizing_base.clas.abap └── zcl_ale_customizing_base.clas.xml ├── zale_example.prog.abap ├── zale_example.prog.xml ├── zale_example_bal_log_creator.prog.abap ├── zale_example_bal_log_creator.prog.xml ├── zale_example_configuration.scp1.xml ├── zale_export_log_bal.prog.abap ├── zale_export_log_bal.prog.xml └── zale_reader ├── package.devc.xml ├── zcl_ale_log_reader_bal.clas.abap ├── zcl_ale_log_reader_bal.clas.xml ├── zcl_ale_log_reader_sm21.clas.abap ├── zcl_ale_log_reader_sm21.clas.xml ├── zcl_ale_log_reader_smicm.clas.abap ├── zcl_ale_log_reader_smicm.clas.xml ├── zif_ale_log_reader.intf.abap └── zif_ale_log_reader.intf.xml /.abapgit.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | E 6 | /src/ 7 | FULL 8 | 9 | /.gitignore 10 | /LICENSE 11 | /README.md 12 | /package.json 13 | /package-lock.json 14 | /.travis.yml 15 | /.gitlab-ci.yml 16 | /abaplint.json 17 | /azure-pipelines.yml 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "npm" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "daily" 12 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name-template: 'v$RESOLVED_VERSION 🌈' 2 | tag-template: 'v$RESOLVED_VERSION' 3 | categories: 4 | - title: '🚀 Features' 5 | labels: 6 | - 'feature' 7 | - 'enhancement' 8 | - title: '🐛 Bug Fixes' 9 | labels: 10 | - 'fix' 11 | - 'bugfix' 12 | - 'bug' 13 | - title: '🧰 Maintenance' 14 | label: 'chore' 15 | - title: '🧺 Miscellaneous' #Everything except ABAP 16 | label: 'misc' 17 | change-template: '- $TITLE @$AUTHOR (#$NUMBER)' 18 | change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. 19 | version-resolver: 20 | major: 21 | labels: 22 | - 'major' 23 | minor: 24 | labels: 25 | - 'minor' 26 | patch: 27 | labels: 28 | - 'patch' 29 | default: patch 30 | template: | 31 | ## Changes 32 | $CHANGES -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name: Release Drafter 2 | 3 | on: 4 | push: 5 | # branches to consider in the event; optional, defaults to all 6 | branches: 7 | - main 8 | 9 | jobs: 10 | update_release_draft: 11 | runs-on: ubuntu-latest 12 | steps: 13 | # Drafts your next Release notes as Pull Requests are merged into "master" 14 | - uses: release-drafter/release-drafter@v5 15 | env: 16 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /.github/workflows/update-changelog.yml: -------------------------------------------------------------------------------- 1 | name: "update changelog" 2 | on: 3 | release: 4 | types: [published] 5 | 6 | jobs: 7 | update-changelog: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v2 11 | 12 | - name: Update changelog 13 | run: | 14 | npm install github-release-notes 15 | export GREN_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} 16 | npm run overrideChangelog 17 | - name: Create Pull Request 18 | uses: peter-evans/create-pull-request@v3 19 | with: 20 | commit-message: update changelog 21 | title: Update Changelog 22 | body: Update changelog to reflect release changes 23 | branch: update-changelog 24 | base: main -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | 3 | # vs code remote 4 | .devcontainer/ -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## v0.3.0 🌈 (08/03/2021) 4 | ## Changes 5 | ## 🚀 Features 6 | 7 | - loki converter and connector added @JohannesKonings (#86) 8 | 9 | ## 🧺 Miscellaneous 10 | 11 | - Bump @abaplint/cli from 2.69.8 to 2.69.10 @dependabot (#87) 12 | - local-test loki versions added and provisioning @JohannesKonings (#84) 13 | - Bump @abaplint/cli from 2.69.7 to 2.69.8 @dependabot (#82) 14 | - Bump @abaplint/cli from 2.69.4 to 2.69.7 @dependabot (#79) 15 | - Update Changelog @github-actions (#78) 16 | 17 | --- 18 | 19 | ## v0.2.0 🌈 (01/03/2021) 20 | ## Changes 21 | ## 🐛 Bug Fixes 22 | 23 | - clear table added in bal reader @JohannesKonings (#76) 24 | 25 | ## 🧰 Maintenance 26 | 27 | - maintenance view for ale config added @JohannesKonings (#75) 28 | - package for component customizing added @JohannesKonings (#72) 29 | 30 | ## 🧺 Miscellaneous 31 | 32 | - Update LICENSE @JohannesKonings (#77) 33 | - Bump @abaplint/cli from 2.69.2 to 2.69.4 @dependabot (#74) 34 | - Bump @abaplint/cli from 2.69.1 to 2.69.2 @dependabot (#71) 35 | - Update Changelog @github-actions (#69) 36 | 37 | --- 38 | 39 | ## v0.1.0 🌈 (23/02/2021) 40 | ## Changes 41 | ## 🚀 Features 42 | 43 | - BAL export enhanced for more objects and subobject @JohannesKonings (#66) 44 | 45 | ## 🧺 Miscellaneous 46 | 47 | - Bump @abaplint/cli from 2.58.26 to 2.69.1 @dependabot (#68) 48 | - package and command for github-release-notes added @JohannesKonings (#65) 49 | - Create dependabot.yml @JohannesKonings (#64) 50 | - vs code remote .devcontainer to gitignore added @JohannesKonings (#62) 51 | 52 | --- 53 | 54 | ## v0.0.1 🌈 (22/02/2021) 55 | ## Changes 56 | 57 | ## 🚀 Features 58 | 59 | - bal export with timeframes added @JohannesKonings (#59) 60 | - Additional fields @JohannesKonings (#48) 61 | - First draft of SM21 reader @JohannesKonings (#42) 62 | - new customizing field + calling of the classes @JohannesKonings (#29) 63 | - header/item for BAL and GELF @JohannesKonings (#28) 64 | - scenario + wrapper @JohannesKonings (#26) 65 | - Connector added to bal export programm @JohannesKonings (#23) 66 | - level of log incl converting for GELF @JohannesKonings (#22) 67 | - rough converter and connector implementation @JohannesKonings (#17) 68 | - Add example programs for log creating and viewing @Goala (#16) 69 | - first rough implementation of bal log reading @JohannesKonings (#13) 70 | - WIP first draft BAL-Reader @JohannesKonings (#4) 71 | 72 | ## 🧰 Maintenance 73 | 74 | - Refactor if ale customizing to abstract class @Goala (#39) 75 | 76 | ## 🐛 Bug Fixes 77 | 78 | - fix customzing type domain values @JohannesKonings (#7) 79 | 80 | ## 🧺 Miscellaneous 81 | 82 | - link and emoji to component status added @JohannesKonings (#56) 83 | - docker compose for graylog 4 added @JohannesKonings (#55) 84 | - docker-compose patch update of graylog and elaticsearch @JohannesKonings (#54) 85 | - grafana tempo removed @JohannesKonings (#51) 86 | - github actions for automatic versioning added @JohannesKonings (#50) 87 | - gh action abaplint removed (will be replaced with abaplint app) @JohannesKonings (#46) 88 | - local test grafana tempo volume @JohannesKonings (#44) 89 | - github workflow rename branch master to main @JohannesKonings (#43) 90 | - update abaplint @JohannesKonings (#40) 91 | - start of components docu @JohannesKonings (#38) 92 | - initial grafana tempo setting for local tests @JohannesKonings (#37) 93 | - logo for readme added @JohannesKonings (#35) 94 | - new folder local-tests with docker compose files @JohannesKonings (#34) 95 | - Add abap field keys @Goala (#32) 96 | - Add additional log systems @Goala (#31) 97 | - Remove files @Goala (#15) 98 | - architecture diagram updated @JohannesKonings (#14) 99 | - Update readme and package.json @Goala (#6) 100 | - readme typo fixed @JohannesKonings (#3) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 abap-observability-tools 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![abap-log-exporter](docs/logo-abap-log-exporter-horizontal.png) 2 | 3 | # abap-log-exporter :construction: WIP 4 | 5 | [![Known Vulnerabilities](https://snyk.io/test/github/Goala/abap-log-exporter/badge.svg?targetFile=package.json)](https://snyk.io/test/github/Goala/abap-log-exporter?targetFile=package.json) 6 | ![GitHub package.json dependency version (dev dep on branch)](https://img.shields.io/github/package-json/dependency-version/Goala/abap-log-exporter/dev/@abaplint/cli) 7 | ![Run abaplint](https://github.com/Goala/abap-log-exporter/workflows/Run%20abaplint/badge.svg) 8 | 9 | # architecture 10 | 11 | ![architecture](./out/architecture/architecture/architecture.png) 12 | 13 | # documentation 14 | 15 | ## components 16 | 17 | | component | variant | status | 18 | | ----------------|----------------|---------| 19 | | reader | BAL | :heavy_check_mark: | 20 | | | SMICM | open | 21 | | | SM21 | [#41](https://github.com/abap-observability-tools/abap-log-exporter/issues/41) | 22 | | converter | GELF | :heavy_check_mark: | 23 | | | Loki | :heavy_check_mark: | 24 | | connector | GELF | :heavy_check_mark: | 25 | | | Loki | :heavy_check_mark: | 26 | 27 | 28 | ## customizing 29 | 30 | Different scenarios can be customized via transaction ZALE_CONFIG. This are the fields for each sceanrio 31 | 32 | | Field | Description | 33 | | ----------------|-------------------------------------| 34 | | reader class | class for the reader component | 35 | | converter class | class for the converter component | 36 | | connector url | URL to the log tool e.g. GrayLog | 37 | | connector class | class for the connector component | 38 | 39 | # local tests 40 | 41 | [local test folder](local-tests/) 42 | 43 | :warning: instead of localhost the URLs have to be customized with the IP of the Ethernet Adapter 44 | -------------------------------------------------------------------------------- /abaplint.json: -------------------------------------------------------------------------------- 1 | { 2 | "global": { 3 | "files": "/src/**/*.*", 4 | "skipGeneratedGatewayClasses": true, 5 | "skipGeneratedPersistentClasses": true, 6 | "skipGeneratedFunctionGroups": true 7 | }, 8 | "dependencies": [ 9 | { 10 | "url": "https://github.com/abaplint/deps", 11 | "folder": "/deps", 12 | "files": "/src/**/*.*" 13 | } 14 | ], 15 | "syntax": { 16 | "version": "v754", 17 | "errorNamespace": "^(Z|Y)", 18 | "globalConstants": [], 19 | "globalMacros": [] 20 | }, 21 | "rules": { 22 | "7bit_ascii": { 23 | "exclude": [], 24 | "reason": "" 25 | }, 26 | "allowed_object_naming": { 27 | "exclude": [], 28 | "reason": "" 29 | }, 30 | "allowed_object_types": { 31 | "exclude": [], 32 | "reason": "", 33 | "allowed": [] 34 | }, 35 | "ambiguous_statement": { 36 | "exclude": [], 37 | "reason": "" 38 | }, 39 | "avoid_use": { 40 | "exclude": [], 41 | "reason": "", 42 | "define": true, 43 | "endselect": true, 44 | "execSQL": true, 45 | "kernelCall": true, 46 | "communication": true, 47 | "statics": true, 48 | "systemCall": true, 49 | "defaultKey": false, 50 | "break": true 51 | }, 52 | "begin_end_names": { 53 | "exclude": [], 54 | "reason": "" 55 | }, 56 | "check_abstract": { 57 | "exclude": [], 58 | "reason": "" 59 | }, 60 | "check_ddic": { 61 | "exclude": [], 62 | "reason": "" 63 | }, 64 | "check_include": { 65 | "exclude": [], 66 | "reason": "" 67 | }, 68 | "check_no_handler_pragma": { 69 | "exclude": [], 70 | "reason": "" 71 | }, 72 | "check_syntax": { 73 | "exclude": [], 74 | "reason": "" 75 | }, 76 | "check_text_elements": { 77 | "exclude": [], 78 | "reason": "" 79 | }, 80 | "check_transformation_exists": { 81 | "exclude": [], 82 | "reason": "" 83 | }, 84 | "cloud_types": { 85 | "exclude": [], 86 | "reason": "" 87 | }, 88 | "colon_missing_space": { 89 | "exclude": [], 90 | "reason": "" 91 | }, 92 | "commented_code": { 93 | "exclude": [], 94 | "reason": "", 95 | "allowIncludeInFugr": true 96 | }, 97 | "constructor_visibility_public": { 98 | "exclude": [], 99 | "reason": "" 100 | }, 101 | "contains_tab": { 102 | "exclude": [], 103 | "reason": "" 104 | }, 105 | "definitions_top": { 106 | "exclude": [], 107 | "reason": "" 108 | }, 109 | "description_empty": { 110 | "exclude": [], 111 | "reason": "" 112 | }, 113 | "double_space": { 114 | "exclude": [], 115 | "reason": "", 116 | "keywords": true, 117 | "startParen": true, 118 | "endParen": true, 119 | "afterColon": true 120 | }, 121 | "empty_line_in_statement": { 122 | "exclude": [], 123 | "reason": "", 124 | "allowChained": false 125 | }, 126 | "empty_statement": { 127 | "exclude": [], 128 | "reason": "" 129 | }, 130 | "empty_structure": { 131 | "exclude": [], 132 | "reason": "", 133 | "loop": true, 134 | "if": true, 135 | "while": true, 136 | "case": true, 137 | "select": true, 138 | "do": true, 139 | "at": true 140 | }, 141 | "exit_or_check": { 142 | "exclude": [], 143 | "reason": "" 144 | }, 145 | "exporting": { 146 | "exclude": [], 147 | "reason": "" 148 | }, 149 | "forbidden_identifier": { 150 | "exclude": [], 151 | "reason": "", 152 | "check": [] 153 | }, 154 | "form_no_dash": { 155 | "exclude": [], 156 | "reason": "" 157 | }, 158 | "form_tables_obsolete": { 159 | "exclude": [], 160 | "reason": "" 161 | }, 162 | "fully_type_constants": { 163 | "exclude": [], 164 | "reason": "", 165 | "checkData": true 166 | }, 167 | "functional_writing": { 168 | "exclude": [], 169 | "reason": "", 170 | "ignoreExceptions": true 171 | }, 172 | "global_class": { 173 | "exclude": [], 174 | "reason": "" 175 | }, 176 | "identical_form_names": { 177 | "exclude": [], 178 | "reason": "" 179 | }, 180 | "if_in_if": { 181 | "exclude": [], 182 | "reason": "" 183 | }, 184 | "in_statement_indentation": { 185 | "exclude": [], 186 | "reason": "", 187 | "ignoreExceptions": true 188 | }, 189 | "indentation": { 190 | "exclude": [], 191 | "reason": "", 192 | "ignoreExceptions": true, 193 | "alignTryCatch": false, 194 | "globalClassSkipFirst": false, 195 | "ignoreGlobalClassDefinition": false, 196 | "ignoreGlobalInterface": false 197 | }, 198 | "inline_data_old_versions": { 199 | "exclude": ["\\w"], 200 | "reason": "" 201 | }, 202 | "keep_single_parameter_on_one_line": { 203 | "exclude": [], 204 | "reason": "", 205 | "length": 120 206 | }, 207 | "keyword_case": { 208 | "exclude": [], 209 | "reason": "", 210 | "style": "upper", 211 | "ignoreExceptions": true, 212 | "ignoreLowerClassImplmentationStatement": true, 213 | "ignoreGlobalClassDefinition": false, 214 | "ignoreGlobalInterface": false, 215 | "ignoreFunctionModuleName": false 216 | }, 217 | "line_only_punc": { 218 | "exclude": [], 219 | "reason": "", 220 | "ignoreExceptions": true 221 | }, 222 | "local_class_naming": { 223 | "exclude": [], 224 | "reason": "", 225 | "patternKind": "required", 226 | "ignoreNames": [], 227 | "ignorePatterns": [], 228 | "local": "^LCL_.+$", 229 | "exception": "^LCX_.+$", 230 | "test": "^LTCL_.+$" 231 | }, 232 | "local_testclass_location": { 233 | "exclude": [], 234 | "reason": "" 235 | }, 236 | "main_file_contents": { 237 | "exclude": [], 238 | "reason": "" 239 | }, 240 | "max_one_statement": { 241 | "exclude": [], 242 | "reason": "" 243 | }, 244 | "message_exists": { 245 | "exclude": [], 246 | "reason": "" 247 | }, 248 | "method_length": { 249 | "exclude": [], 250 | "reason": "", 251 | "statements": 100, 252 | "errorWhenEmpty": true, 253 | "ignoreTestClasses": false 254 | }, 255 | "method_parameter_names": { 256 | "exclude": [], 257 | "reason": "", 258 | "patternKind": "required", 259 | "ignoreNames": [], 260 | "ignorePatterns": [], 261 | "ignoreExceptions": true, 262 | "importing": "\\w", 263 | "returning": "\\w", 264 | "changing": "\\w", 265 | "exporting": "\\w" 266 | }, 267 | "mix_returning": { 268 | "exclude": [], 269 | "reason": "" 270 | }, 271 | "msag_consistency": { 272 | "exclude": [], 273 | "reason": "" 274 | }, 275 | "nesting": { 276 | "exclude": [], 277 | "reason": "", 278 | "depth": 5 279 | }, 280 | "newline_between_methods": { 281 | "exclude": [], 282 | "reason": "", 283 | "count": 3, 284 | "logic": "less" 285 | }, 286 | "no_public_attributes": { 287 | "exclude": [], 288 | "reason": "", 289 | "allowReadOnly": false 290 | }, 291 | "object_naming": { 292 | "exclude": [], 293 | "reason": "", 294 | "patternKind": "required", 295 | "ignoreNames": [], 296 | "ignorePatterns": [], 297 | "clas": "^ZC(L|X)\\_", 298 | "intf": "^ZIF\\_", 299 | "prog": "^Z", 300 | "fugr": "^Z", 301 | "tabl": "^Z", 302 | "ttyp": "^Z", 303 | "dtel": "^Z", 304 | "doma": "^Z", 305 | "msag": "^Z", 306 | "tran": "^Z", 307 | "enqu": "^EZ", 308 | "auth": "^Z", 309 | "pinf": "^Z", 310 | "idoc": "^Z", 311 | "xslt": "^Z", 312 | "ssfo": "^Z", 313 | "ssst": "^Z" 314 | }, 315 | "obsolete_statement": { 316 | "exclude": [], 317 | "reason": "", 318 | "refresh": true, 319 | "compute": true, 320 | "add": true, 321 | "subtract": true, 322 | "multiply": true, 323 | "move": true, 324 | "divide": true, 325 | "requested": true, 326 | "occurs": true, 327 | "setExtended": true 328 | }, 329 | "parser_error": { 330 | "exclude": [], 331 | "reason": "" 332 | }, 333 | "prefer_returning_to_exporting": { 334 | "exclude": [], 335 | "reason": "" 336 | }, 337 | "preferred_compare_operator": { 338 | "exclude": [], 339 | "reason": "", 340 | "badOperators": [ 341 | "EQ", 342 | "><", 343 | "NE", 344 | "GE", 345 | "GT", 346 | "LT", 347 | "LE" 348 | ] 349 | }, 350 | "prefix_is_current_class": { 351 | "exclude": [], 352 | "reason": "", 353 | "omitMeInstanceCalls": false 354 | }, 355 | "release_idoc": { 356 | "exclude": [], 357 | "reason": "" 358 | }, 359 | "remove_descriptions": { 360 | "exclude": [], 361 | "reason": "", 362 | "ignoreExceptions": false 363 | }, 364 | "rfc_error_handling": { 365 | "exclude": [], 366 | "reason": "" 367 | }, 368 | "selection_screen_naming": { 369 | "exclude": [], 370 | "reason": "", 371 | "patternKind": "required", 372 | "ignoreNames": [], 373 | "ignorePatterns": [], 374 | "parameter": "\\w", 375 | "selectOption": "\\w" 376 | }, 377 | "sequential_blank": { 378 | "exclude": [], 379 | "reason": "", 380 | "lines": 4 381 | }, 382 | "short_case": { 383 | "exclude": [], 384 | "reason": "", 385 | "length": 1, 386 | "allow": [] 387 | }, 388 | "sicf_consistency": { 389 | "exclude": [], 390 | "reason": "" 391 | }, 392 | "space_before_colon": { 393 | "exclude": [], 394 | "reason": "" 395 | }, 396 | "space_before_dot": { 397 | "exclude": [], 398 | "reason": "", 399 | "ignoreGlobalDefinition": true, 400 | "ignoreExceptions": true 401 | }, 402 | "sql_escape_host_variables": { 403 | "exclude": [], 404 | "reason": "" 405 | }, 406 | "start_at_tab": { 407 | "exclude": [], 408 | "reason": "" 409 | }, 410 | "superclass_final": { 411 | "exclude": [], 412 | "reason": "" 413 | }, 414 | "tabl_enhancement_category": { 415 | "exclude": [], 416 | "reason": "" 417 | }, 418 | "try_without_catch": { 419 | "exclude": [], 420 | "reason": "" 421 | }, 422 | "type_begin_single_include": { 423 | "exclude": [], 424 | "reason": "" 425 | }, 426 | "type_form_parameters": { 427 | "exclude": [], 428 | "reason": "" 429 | }, 430 | "types_naming": { 431 | "exclude": [], 432 | "reason": "", 433 | "pattern": "\\w" 434 | }, 435 | "unknown_types": { 436 | "exclude": ["\\w"], 437 | "reason": "" 438 | }, 439 | "unreachable_code": { 440 | "exclude": [], 441 | "reason": "" 442 | }, 443 | "use_new": { 444 | "exclude": [], 445 | "reason": "" 446 | }, 447 | "when_others_last": { 448 | "exclude": [], 449 | "reason": "" 450 | }, 451 | "whitespace_end": { 452 | "exclude": [], 453 | "reason": "" 454 | }, 455 | "xml_consistency": { 456 | "exclude": [], 457 | "reason": "" 458 | } 459 | } 460 | } 461 | -------------------------------------------------------------------------------- /architecture/architecture.planuml: -------------------------------------------------------------------------------- 1 | @startuml architecture 2 | 3 | database "BAL" { 4 | } 5 | database "SMICM" { 6 | } 7 | database "SM21" { 8 | } 9 | 10 | () "job scheduling" - program 11 | 12 | node "program" { 13 | BAL --> [log reader] 14 | SMICM --> [log reader] 15 | SM21 --> [log reader] 16 | [log reader] --> [log converter] 17 | [log converter] --> [log connector] 18 | } 19 | 20 | [customizing] --> [log reader] 21 | [customizing] --> [log converter] 22 | [customizing] --> [log connector] 23 | 24 | [log connector] --> [GELF] 25 | [log connector] --> [Loki] 26 | [log connector] --> [Fluentd] 27 | [log connector] ..> [Additional log systems] 28 | 29 | 30 | @enduml -------------------------------------------------------------------------------- /docs/logo-abap-log-exporter-horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abap-observability-tools/abap-log-exporter/951d9d00cd2dcef9f3ef61a94e70b4bca1d450f5/docs/logo-abap-log-exporter-horizontal.png -------------------------------------------------------------------------------- /docs/logo-abap-log-exporter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abap-observability-tools/abap-log-exporter/951d9d00cd2dcef9f3ef61a94e70b4bca1d450f5/docs/logo-abap-log-exporter.png -------------------------------------------------------------------------------- /local-tests/README.md: -------------------------------------------------------------------------------- 1 | # abap-log-exporter 2 | ## start 3 | 4 | ``` 5 | docker-compose -f docker-compose-graylog.yml up 6 | docker-compose -f docker-compose-graylog4.yml up 7 | docker-compose -f docker-compose-grafana-loki.yml up 8 | docker-compose -f docker-compose-fluentd.yml up 9 | ``` 10 | 11 | ## updates 12 | 13 | ### graylog 14 | 15 | plugins: https://docs.graylog.org/en/3.3/pages/integrations/setup.html 16 | 17 | ## utils 18 | 19 | ### Loki 20 | 21 | ``` 22 | curl -v -H "Content-Type: application/json" -XPOST -s "http://localhost:3100/api/prom/push" --data-raw '{"streams": [{ "labels": "{foo=\"bar\"}", "entries": [{ "ts": "2020-04-11T14:01:06.801064-04:00", "line": "fizzbuzz" }] }]}' 23 | ``` 24 | 25 | ### graylog 26 | 27 | ``` 28 | curl -v -X POST -H 'Content-Type: application/json' -d '{ "version": "1.1", "host": "example.org", "short_message": "A short message", "level": 5, "_some_info": "foo" }' 'http://graylog:12201/gelf' 29 | ``` 30 | ### fluentd 31 | 32 | ``` 33 | curl -X POST -d 'json={"json":"message"}' http://localhost:9880/sample.test 34 | ``` 35 | 36 | ## based on 37 | 38 | ### Loki 39 | 40 | https://github.com/grafana/loki/tree/master/production 41 | 42 | ### graylog 43 | 44 | https://hometechhacker.com/how-to-create-a-graylog-container-in-docker/ 45 | 46 | https://mfyz.com/quick-and-dirty-set-up-graylog-in-5-minutes-with-docker/ 47 | 48 | https://github.com/pecigonzalo/graylog-compose/blob/master/docker-compose.yml 49 | 50 | https://gist.github.com/Ghostbird/2365c64c6cb125566e1ee55737bedd5a 51 | 52 | https://docs.graylog.org/en/4.0/pages/installation/docker.html 53 | 54 | ### fluentd 55 | 56 | https://docs.fluentd.org/v/0.12/container-deployment/install-by-docker 57 | -------------------------------------------------------------------------------- /local-tests/docker-compose-fluentd.yml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | services: 3 | fluentd: 4 | image: fluent/fluentd 5 | volumes: 6 | - ./fluentd/conf:/fluentd/etc 7 | ports: 8 | - "9880:9880" -------------------------------------------------------------------------------- /local-tests/docker-compose-grafana-loki.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | 3 | networks: 4 | loki: 5 | 6 | services: 7 | loki: 8 | image: grafana/loki:2.1.0 9 | ports: 10 | - "3100:3100" 11 | command: -config.file=/etc/loki/local-config.yaml 12 | networks: 13 | - loki 14 | 15 | promtail: 16 | image: grafana/promtail:2.1.0 17 | volumes: 18 | - /var/log:/var/log 19 | command: -config.file=/etc/promtail/docker-config.yaml 20 | networks: 21 | - loki 22 | 23 | grafana: 24 | image: grafana/grafana:7.4.3 25 | ports: 26 | - "3000:3000" 27 | networks: 28 | - loki 29 | volumes: 30 | - ./grafana/provisioning/:/etc/grafana/provisioning/ 31 | 32 | volumes: 33 | grafana_data: {} -------------------------------------------------------------------------------- /local-tests/docker-compose-graylog.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | mongodb: 4 | image: mongo:3 5 | elasticsearch: 6 | image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.14 7 | environment: 8 | - http.host=0.0.0.0 9 | - transport.host=localhost 10 | - network.host=0.0.0.0 11 | - "ES_JAVA_OPTS=-Xms512m -Xmx512m" 12 | ulimits: 13 | memlock: 14 | soft: -1 15 | hard: -1 16 | mem_limit: 1g 17 | graylog: 18 | image: graylog/graylog:3.3.8 19 | environment: 20 | - GRAYLOG_PASSWORD_SECRET=mfyz11sanane22banane 21 | # Password: admin 22 | - GRAYLOG_ROOT_PASSWORD_SHA2=8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918 23 | - GRAYLOG_HTTP_EXTERNAL_URI=http://127.0.0.1:9000/ 24 | volumes: 25 | - ./graylog/plugin/:/usr/share/graylog/plugin/ 26 | links: 27 | - mongodb:mongo 28 | - elasticsearch 29 | depends_on: 30 | - mongodb 31 | - elasticsearch 32 | ports: 33 | - 9000:9000 # Graylog web interface and REST API 34 | - 5555:5555 # Raw/Plaintext TCP 35 | - 1514:1514 # Syslog TCP 36 | - 1514:1514/udp # Syslog UDP 37 | - 12201:12201 # GELF TCP 38 | - 12201:12201/udp # GELF UDP -------------------------------------------------------------------------------- /local-tests/docker-compose-graylog4.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | # MongoDB: https://hub.docker.com/_/mongo/ 4 | mongo: 5 | image: mongo:4.4.4 6 | networks: 7 | - graylog 8 | # Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/7.10/docker.html 9 | elasticsearch: 10 | image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2 11 | environment: 12 | - http.host=0.0.0.0 13 | - transport.host=localhost 14 | - network.host=0.0.0.0 15 | - "ES_JAVA_OPTS=-Xms512m -Xmx512m" 16 | ulimits: 17 | memlock: 18 | soft: -1 19 | hard: -1 20 | deploy: 21 | resources: 22 | limits: 23 | memory: 1g 24 | networks: 25 | - graylog 26 | # Graylog: https://hub.docker.com/r/graylog/graylog/ 27 | graylog: 28 | image: graylog/graylog:4.0.3 29 | environment: 30 | # CHANGE ME (must be at least 16 characters)! 31 | - GRAYLOG_PASSWORD_SECRET=somepasswordpepper 32 | # Password: admin 33 | - GRAYLOG_ROOT_PASSWORD_SHA2=8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918 34 | - GRAYLOG_HTTP_EXTERNAL_URI=http://localhost:9000/ 35 | entrypoint: /usr/bin/tini -- wait-for-it elasticsearch:9200 -- /docker-entrypoint.sh 36 | networks: 37 | - graylog 38 | restart: always 39 | depends_on: 40 | - mongo 41 | - elasticsearch 42 | ports: 43 | # Graylog web interface and REST API 44 | - 9000:9000 45 | # Syslog TCP 46 | - 1514:1514 47 | # Syslog UDP 48 | - 1514:1514/udp 49 | # GELF TCP 50 | - 12201:12201 51 | # GELF UDP 52 | - 12201:12201/udp 53 | networks: 54 | graylog: 55 | driver: bridge -------------------------------------------------------------------------------- /local-tests/fluentd/conf/fluent.conf: -------------------------------------------------------------------------------- 1 | # fluentd/conf/fluent.conf 2 | #https://docs.fluentd.org/v/0.12/input/http 3 | 4 | @type http 5 | port 9880 6 | bind 0.0.0.0 7 | body_size_limit 32m 8 | keepalive_timeout 10s 9 | 10 | 11 | @type stdout 12 | -------------------------------------------------------------------------------- /local-tests/grafana/provisioning/datasources/loki.yml: -------------------------------------------------------------------------------- 1 | # config file version 2 | apiVersion: 1 3 | 4 | # list of datasources that should be deleted from the database 5 | deleteDatasources: 6 | - name: loki 7 | orgId: 1 8 | 9 | # list of datasources to insert/update depending 10 | # whats available in the database 11 | datasources: 12 | # name of the datasource. Required 13 | - name: loki 14 | # datasource type. Required 15 | type: loki 16 | # access mode. direct or proxy. Required 17 | access: proxy 18 | # org id. will default to orgId 1 if not specified 19 | orgId: 1 20 | # url 21 | url: http://loki:3100 22 | # database password, if used 23 | password: "admin" 24 | # database user, if used 25 | user: "admin" 26 | # database name, if used 27 | database: "loki" 28 | # enable/disable basic auth 29 | basicAuth: false 30 | # withCredentials: 31 | # mark as default datasource. Max one per org 32 | isDefault: true 33 | # fields that will be converted to json and stored in json_data 34 | jsonData: 35 | timeInterval: "5s" 36 | # graphiteVersion: "1.1" 37 | # tlsAuth: false 38 | # tlsAuthWithCACert: false 39 | # # json object of data that will be encrypted. 40 | # secureJsonData: 41 | # tlsCACert: "..." 42 | # tlsClientCert: "..." 43 | # tlsClientKey: "..." 44 | version: 1 45 | # allow users to edit datasources from the UI. 46 | editable: false -------------------------------------------------------------------------------- /local-tests/graylog/plugin/graylog-plugin-integrations-3.3.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abap-observability-tools/abap-log-exporter/951d9d00cd2dcef9f3ef61a94e70b4bca1d450f5/local-tests/graylog/plugin/graylog-plugin-integrations-3.3.5.jar -------------------------------------------------------------------------------- /out/architecture/architecture/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abap-observability-tools/abap-log-exporter/951d9d00cd2dcef9f3ef61a94e70b4bca1d450f5/out/architecture/architecture/architecture.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "abap-log-exporter", 3 | "version": "0.0.1", 4 | "description": "abap-log-exporter", 5 | "scripts": { 6 | "lint": "abaplint", 7 | "overrideChangelog": "gren changelog --override" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/Goala/abap-log-exporter.git" 12 | }, 13 | "keywords": [ 14 | "abap", 15 | "logs", 16 | "sap-netweaver" 17 | ], 18 | "author": "Johannes Konings", 19 | "contributors": [ 20 | "Max Stenke" 21 | ], 22 | "license": "MIT", 23 | "bugs": { 24 | "url": "https://github.com/Goala/abap-log-exporter/issues" 25 | }, 26 | "homepage": "https://github.com/Goala/abap-log-exporter#readme", 27 | "devDependencies": { 28 | "github-release-notes": "^0.17.3" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/package.devc.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | abap-log-exporter 7 | X 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/zale_connector/package.devc.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ale connector 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/zale_connector/zcl_ale_log_connector_gelf.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_ale_log_connector_gelf DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | INTERFACES zif_ale_log_connector. 9 | 10 | PROTECTED SECTION. 11 | PRIVATE SECTION. 12 | ENDCLASS. 13 | 14 | 15 | 16 | CLASS zcl_ale_log_connector_gelf IMPLEMENTATION. 17 | METHOD zif_ale_log_connector~connect. 18 | 19 | DATA xjson TYPE xstring. 20 | DATA text TYPE string. 21 | 22 | DATA(gelf_url) = customizing->get_connector_url( ). 23 | 24 | LOOP AT converted_logs ASSIGNING FIELD-SYMBOL(). 25 | 26 | cl_http_client=>create_by_url( 27 | EXPORTING 28 | url = CONV #( gelf_url ) 29 | IMPORTING 30 | client = DATA(client) 31 | EXCEPTIONS 32 | argument_not_found = 1 33 | plugin_not_active = 2 34 | internal_error = 3 35 | OTHERS = 4 ). 36 | IF sy-subrc <> 0. 37 | ASSERT 1 = 2. 38 | ENDIF. 39 | 40 | client->request->set_method( 'POST' ). 41 | client->request->set_content_type( 'application/json' ). 42 | 43 | text = -json. 44 | 45 | CALL FUNCTION 'SCMS_STRING_TO_XSTRING' 46 | EXPORTING 47 | text = text 48 | * mimetype = SPACE 49 | * encoding = 50 | IMPORTING 51 | buffer = xjson 52 | EXCEPTIONS 53 | failed = 1 54 | OTHERS = 2. 55 | IF sy-subrc <> 0. 56 | MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno 57 | WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 58 | ENDIF. 59 | 60 | client->request->set_data( xjson ). 61 | 62 | client->send( 63 | EXCEPTIONS 64 | http_communication_failure = 1 65 | http_invalid_state = 2 66 | http_processing_failed = 3 67 | http_invalid_timeout = 4 68 | OTHERS = 5 ). 69 | IF sy-subrc <> 0. 70 | ASSERT 1 = 2. 71 | ENDIF. 72 | 73 | client->receive( 74 | EXCEPTIONS 75 | http_communication_failure = 1 76 | http_invalid_state = 2 77 | http_processing_failed = 3 78 | OTHERS = 4 ). 79 | IF sy-subrc <> 0. 80 | ASSERT 1 = 2. 81 | ENDIF. 82 | 83 | client->response->get_status( IMPORTING 84 | code = DATA(http_code) 85 | reason = DATA(reason) ). 86 | 87 | ENDLOOP. 88 | 89 | ENDMETHOD. 90 | 91 | ENDCLASS. 92 | -------------------------------------------------------------------------------- /src/zale_connector/zcl_ale_log_connector_gelf.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ALE_LOG_CONNECTOR_GELF 7 | E 8 | Log Connector GELF 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zale_connector/zcl_ale_log_connector_loki.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_ale_log_connector_loki DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | INTERFACES zif_ale_log_connector. 9 | 10 | PROTECTED SECTION. 11 | PRIVATE SECTION. 12 | ENDCLASS. 13 | 14 | 15 | 16 | CLASS zcl_ale_log_connector_loki IMPLEMENTATION. 17 | METHOD zif_ale_log_connector~connect. 18 | 19 | DATA(loki_url) = customizing->get_connector_url( ). 20 | 21 | LOOP AT converted_logs ASSIGNING FIELD-SYMBOL(). 22 | 23 | cl_http_client=>create_by_url( 24 | EXPORTING 25 | url = CONV #( loki_url ) 26 | IMPORTING 27 | client = DATA(client) 28 | EXCEPTIONS 29 | argument_not_found = 1 30 | plugin_not_active = 2 31 | internal_error = 3 32 | OTHERS = 4 ). 33 | IF sy-subrc <> 0. 34 | ASSERT 1 = 2. 35 | ENDIF. 36 | 37 | client->request->set_method( 'POST' ). 38 | client->request->set_content_type( 'application/json' ). 39 | 40 | TRY. 41 | DATA(xjson) = cl_binary_convert=>string_to_xstring_utf8( iv_string = -json ). 42 | CATCH cx_sy_conversion_error. 43 | ASSERT 1 = 2. 44 | ENDTRY. 45 | 46 | client->request->set_data( xjson ). 47 | 48 | client->send( 49 | EXCEPTIONS 50 | http_communication_failure = 1 51 | http_invalid_state = 2 52 | http_processing_failed = 3 53 | http_invalid_timeout = 4 54 | OTHERS = 5 ). 55 | IF sy-subrc <> 0. 56 | ASSERT 1 = 2. 57 | ENDIF. 58 | 59 | client->receive( 60 | EXCEPTIONS 61 | http_communication_failure = 1 62 | http_invalid_state = 2 63 | http_processing_failed = 3 64 | OTHERS = 4 ). 65 | IF sy-subrc <> 0. 66 | client->response->get_status( IMPORTING 67 | code = DATA(http_code) 68 | reason = DATA(reason) ). 69 | ASSERT 1 = 2. 70 | ENDIF. 71 | ENDLOOP. 72 | ENDMETHOD. 73 | 74 | ENDCLASS. 75 | -------------------------------------------------------------------------------- /src/zale_connector/zcl_ale_log_connector_loki.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ALE_LOG_CONNECTOR_LOKI 7 | E 8 | Log Connector Loki 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zale_connector/zif_ale_log_connector.intf.abap: -------------------------------------------------------------------------------- 1 | INTERFACE zif_ale_log_connector 2 | PUBLIC . 3 | 4 | METHODS connect 5 | IMPORTING converted_logs TYPE zif_ale_log_converter=>ty_converted_logs 6 | customizing TYPE REF TO zcl_ale_customizing. 7 | 8 | ENDINTERFACE. 9 | -------------------------------------------------------------------------------- /src/zale_connector/zif_ale_log_connector.intf.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZIF_ALE_LOG_CONNECTOR 7 | E 8 | Log Connector 9 | 2 10 | 1 11 | X 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/zale_converter/package.devc.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | converting logs 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/zale_converter/zcl_ale_log_converter_gelf.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_ale_log_converter_gelf DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | INTERFACES zif_ale_log_converter. 9 | 10 | CONSTANTS: 11 | "! GELF log levels https://www.rubydoc.info/github/graylog-labs/gelf-rb/GELF/Levels 12 | BEGIN OF con_gelf_level, 13 | debug TYPE i VALUE 0, 14 | info TYPE i VALUE 1, 15 | warn TYPE i VALUE 2, 16 | error TYPE i VALUE 3, 17 | fatal TYPE i VALUE 4, 18 | unknown TYPE i VALUE 5, 19 | emergency TYPE i VALUE 10, 20 | alert TYPE i VALUE 11, 21 | critical TYPE i VALUE 12, 22 | warning TYPE i VALUE 14, 23 | notice TYPE i VALUE 15, 24 | informational TYPE i VALUE 16, 25 | END OF con_gelf_level. 26 | 27 | PROTECTED SECTION. 28 | PRIVATE SECTION. 29 | ENDCLASS. 30 | 31 | 32 | 33 | CLASS zcl_ale_log_converter_gelf IMPLEMENTATION. 34 | 35 | METHOD zif_ale_log_converter~convert. 36 | 37 | LOOP AT logs ASSIGNING FIELD-SYMBOL(). 38 | 39 | DATA(level) = SWITCH integer( -level 40 | WHEN zif_ale_log_reader=>con_log_level-info THEN con_gelf_level-info 41 | WHEN zif_ale_log_reader=>con_log_level-warning THEN con_gelf_level-warning 42 | WHEN zif_ale_log_reader=>con_log_level-error THEN con_gelf_level-error 43 | ELSE con_gelf_level-informational ). 44 | 45 | DATA(additional_fields_section) = REDUCE string( INIT json_field = || 46 | FOR additional_field IN -additional_fields 47 | NEXT json_field = |{ json_field }"_{ additional_field-field }": "{ additional_field-value }",| ). 48 | 49 | DATA(gelf_json) = |\{| && 50 | |"version": "1.1",| && 51 | |"host": "{ sy-host }",| && 52 | |"short_message": "{ -header_text }",| && 53 | |"full_message": "{ -item_text }",| && 54 | |"level": { level },| && 55 | |{ additional_fields_section }| && 56 | |\}|. 57 | 58 | converted_logs = VALUE #( BASE converted_logs ( json = gelf_json ) ). 59 | 60 | ENDLOOP. 61 | 62 | 63 | ENDMETHOD. 64 | 65 | ENDCLASS. 66 | -------------------------------------------------------------------------------- /src/zale_converter/zcl_ale_log_converter_gelf.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ALE_LOG_CONVERTER_GELF 7 | E 8 | Log Converter GELF 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zale_converter/zcl_ale_log_converter_loki.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_ale_log_converter_loki DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | INTERFACES zif_ale_log_converter. 9 | 10 | PROTECTED SECTION. 11 | PRIVATE SECTION. 12 | ENDCLASS. 13 | 14 | 15 | 16 | CLASS zcl_ale_log_converter_loki IMPLEMENTATION. 17 | METHOD zif_ale_log_converter~convert. 18 | 19 | LOOP AT logs ASSIGNING FIELD-SYMBOL(). 20 | 21 | DATA(object) = -additional_fields[ field = 'object' ]-value. 22 | 23 | DATA(loki_json) = |\{"streams": | && 24 | |[| && 25 | |\{ "labels": "\{ object=\\"{ object }\\" \}",| && 26 | |"entries": [| && 27 | |\{ "ts": "{ -timestamp TIMESTAMP = ISO }Z", "line": "{ -item_text }" \}| && 28 | |] \}]\}|. 29 | 30 | converted_logs = VALUE #( BASE converted_logs ( json = loki_json ) ). 31 | 32 | ENDLOOP. 33 | ENDMETHOD. 34 | 35 | ENDCLASS. 36 | -------------------------------------------------------------------------------- /src/zale_converter/zcl_ale_log_converter_loki.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ALE_LOG_CONVERTER_LOKI 7 | E 8 | Log Converter Loki 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zale_converter/zif_ale_log_converter.intf.abap: -------------------------------------------------------------------------------- 1 | INTERFACE zif_ale_log_converter 2 | PUBLIC . 3 | 4 | TYPES: BEGIN OF ty_converted_log, 5 | json TYPE string, 6 | END OF ty_converted_log. 7 | 8 | TYPES ty_converted_logs TYPE STANDARD TABLE OF ty_converted_log WITH DEFAULT KEY. 9 | 10 | METHODS convert 11 | IMPORTING logs TYPE zif_ale_log_reader=>ty_logs 12 | customizing TYPE REF TO zcl_ale_customizing 13 | RETURNING VALUE(converted_logs) TYPE ty_converted_logs. 14 | 15 | ENDINTERFACE. 16 | -------------------------------------------------------------------------------- /src/zale_converter/zif_ale_log_converter.intf.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZIF_ALE_LOG_CONVERTER 7 | E 8 | Log Converter 9 | 2 10 | 1 11 | X 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/zale_customizing/package.devc.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | customizing of the scenarios 7 | X 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_config.tabl.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZALE_CONFIG 7 | E 8 | TRANSP 9 | abap-log-exporter configuration 10 | E 11 | X 12 | C 13 | 1 14 | 15 | 16 | ZALE_CONFIG 17 | A 18 | 0 19 | APPL2 20 | N 21 | 22 | 23 | 24 | LOG_SCENARIO 25 | X 26 | ZALE_LOG_SCENARIO 27 | 0 28 | X 29 | E 30 | 31 | 32 | READER_CLASS 33 | ZALE_READER_CLASS 34 | 0 35 | E 36 | 37 | 38 | CONVERTER_CLASS 39 | ZALE_CONVERTER_CLASS 40 | 0 41 | E 42 | 43 | 44 | CONNECTOR_CLASS 45 | ZALE_CONNECTOR_CLASS 46 | 0 47 | E 48 | 49 | 50 | CONNECTOR_URL 51 | ZALE_CONNECTOR_URL 52 | 0 53 | E 54 | 55 | 56 | 57 | 58 | ZALE_CONFIG 59 | &NC& 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_config.tran.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZALE_CONFIG 7 | Ag== 8 | 9 | 10 | ZALE_CONFIG 11 | 1 12 | X 13 | X 14 | 15 | 16 | E 17 | ZALE_CONFIG 18 | amp config 19 | 20 | 21 | ZALE_CONFIG 22 | /*SM30 VIEWNAME=zale_config;UPDATE=X; 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_config_mp.fugr.lzale_config_mpf00.abap: -------------------------------------------------------------------------------- 1 | *---------------------------------------------------------------------* 2 | * view related FORM routines 3 | * generation date: 27.02.2021 at 08:52:17 4 | * view maintenance generator version: #001407# 5 | *---------------------------------------------------------------------* 6 | 7 | * base table related FORM-routines............. 8 | INCLUDE LSVIMFTX . 9 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_config_mp.fugr.lzale_config_mpf00.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | LZALE_CONFIG_MPF00 7 | X 8 | I 9 | E 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_config_mp.fugr.lzale_config_mpi00.abap: -------------------------------------------------------------------------------- 1 | *---------------------------------------------------------------------* 2 | * view related PAI modules 3 | * generation date: 27.02.2021 at 08:52:17 4 | * view maintenance generator version: #001407# 5 | *---------------------------------------------------------------------* 6 | 7 | INCLUDE LSVIMITX . "base table related PAI modules 8 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_config_mp.fugr.lzale_config_mpi00.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | LZALE_CONFIG_MPI00 7 | X 8 | I 9 | E 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_config_mp.fugr.lzale_config_mpt00.abap: -------------------------------------------------------------------------------- 1 | *---------------------------------------------------------------------* 2 | * view related data declarations 3 | * generation date: 27.02.2021 at 08:52:17 4 | * view maintenance generator version: #001407# 5 | *---------------------------------------------------------------------* 6 | *...processing: ZALE_CONFIG.....................................* 7 | DATA: BEGIN OF STATUS_ZALE_CONFIG . "state vector 8 | INCLUDE STRUCTURE VIMSTATUS. 9 | DATA: END OF STATUS_ZALE_CONFIG . 10 | CONTROLS: TCTRL_ZALE_CONFIG 11 | TYPE TABLEVIEW USING SCREEN '0001'. 12 | *.........table declarations:.................................* 13 | TABLES: *ZALE_CONFIG . 14 | TABLES: ZALE_CONFIG . 15 | 16 | * general table data declarations.............. 17 | INCLUDE LSVIMTDT . 18 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_config_mp.fugr.lzale_config_mpt00.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | LZALE_CONFIG_MPT00 7 | I 8 | E 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_config_mp.fugr.lzale_config_mptop.abap: -------------------------------------------------------------------------------- 1 | * regenerated at 27.02.2021 08:52:17 2 | FUNCTION-POOL ZALE_CONFIG_MP MESSAGE-ID SV. 3 | 4 | * INCLUDE LZALE_CONFIG_MPD... " Local class definition 5 | INCLUDE LSVIMDAT . "general data decl. 6 | INCLUDE LZALE_CONFIG_MPT00 . "view rel. data dcl. 7 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_config_mp.fugr.lzale_config_mptop.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | LZALE_CONFIG_MPTOP 7 | S 8 | D$ 9 | I 10 | S 11 | X 12 | D$S 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_config_mp.fugr.saplzale_config_mp.abap: -------------------------------------------------------------------------------- 1 | * regenerated at 27.02.2021 08:52:17 2 | ******************************************************************* 3 | * System-defined Include-files. * 4 | ******************************************************************* 5 | INCLUDE LZALE_CONFIG_MPTOP. " Global Declarations 6 | INCLUDE LZALE_CONFIG_MPUXX. " Function Modules 7 | 8 | ******************************************************************* 9 | * User-defined Include-files (if necessary). * 10 | ******************************************************************* 11 | * INCLUDE LZALE_CONFIG_MPF... " Subroutines 12 | * INCLUDE LZALE_CONFIG_MPO... " PBO-Modules 13 | * INCLUDE LZALE_CONFIG_MPI... " PAI-Modules 14 | * INCLUDE LZALE_CONFIG_MPE... " Events 15 | * INCLUDE LZALE_CONFIG_MPP... " Local class implement. 16 | * INCLUDE LZALE_CONFIG_MPT99. " ABAP Unit tests 17 | INCLUDE LZALE_CONFIG_MPF00 . " subprograms 18 | INCLUDE LZALE_CONFIG_MPI00 . " PAI modules 19 | INCLUDE LSVIMFXX . " subprograms 20 | INCLUDE LSVIMOXX . " PBO modules 21 | INCLUDE LSVIMIXX . " PAI modules 22 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_config_mp.fugr.saplzale_config_mp.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | SAPLZALE_CONFIG_MP 7 | X 8 | S 9 | D$ 10 | F 11 | S 12 | E 13 | X 14 | D$S 15 | X 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_config_mp.fugr.tableframe_zale_config_mp.abap: -------------------------------------------------------------------------------- 1 | *---------------------------------------------------------------------* 2 | * program for: TABLEFRAME_ZALE_CONFIG_MP 3 | * generation date: 27.02.2021 at 08:52:17 4 | * view maintenance generator version: #001407# 5 | *---------------------------------------------------------------------* 6 | FUNCTION TABLEFRAME_ZALE_CONFIG_MP . 7 | 8 | PERFORM TABLEFRAME TABLES X_HEADER X_NAMTAB DBA_SELLIST DPL_SELLIST 9 | EXCL_CUA_FUNCT 10 | USING CORR_NUMBER VIEW_ACTION VIEW_NAME. 11 | 12 | ENDFUNCTION. 13 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_config_mp.fugr.tableproc_zale_config_mp.abap: -------------------------------------------------------------------------------- 1 | *---------------------------------------------------------------------* 2 | * program for: TABLEPROC_ZALE_CONFIG_MP 3 | * generation date: 27.02.2021 at 08:52:17 4 | * view maintenance generator version: #001407# 5 | *---------------------------------------------------------------------* 6 | FUNCTION TABLEPROC_ZALE_CONFIG_MP . 7 | 8 | PERFORM TABLEPROC. 9 | 10 | ENDFUNCTION. 11 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_config_mp.fugr.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Extended Table Maintenance (Generated) 6 | 7 | LZALE_CONFIG_MPF00 8 | LZALE_CONFIG_MPI00 9 | LZALE_CONFIG_MPTOP 10 | LZALE_CONFIG_MPT00 11 | SAPLZALE_CONFIG_MP 12 | 13 | 14 | 15 | TABLEFRAME_ZALE_CONFIG_MP 16 | Extended Table Maintenance: Upper Level 17 | 18 | 19 | VIEW_ACTION 20 | 'S' 21 | 22 | 23 | VIEW_NAME 24 | DD02V-TABNAME 25 | 26 | 27 | CORR_NUMBER 28 | E070-TRKORR 29 | ' ' 30 | 31 | 32 | 33 | 34 | DBA_SELLIST 35 | VIMSELLIST 36 | 37 | 38 | DPL_SELLIST 39 | VIMSELLIST 40 | 41 | 42 | EXCL_CUA_FUNCT 43 | VIMEXCLFUN 44 | 45 | 46 | X_HEADER 47 | VIMDESC 48 | 49 | 50 | X_NAMTAB 51 | VIMNAMTAB 52 | 53 | 54 | 55 | 56 | MISSING_CORR_NUMBER 57 | 58 | 59 | 60 | 61 | VIEW_ACTION 62 | P 63 | Aktion mit Tabelle: anz./änd./transp. (S/U/T) 64 | 65 | 66 | VIEW_NAME 67 | P 68 | Name der Tabelle 69 | 70 | 71 | CORR_NUMBER 72 | P 73 | Korrekturnummer für durchgeführte Änderungen 74 | 75 | 76 | DBA_SELLIST 77 | P 78 | Selektionsbedingungen für den DB-Zugriff 79 | 80 | 81 | DPL_SELLIST 82 | P 83 | Selektionsbedingungen für die Anzeige 84 | 85 | 86 | EXCL_CUA_FUNCT 87 | P 88 | Tabelle mit dynam. zu deaktivierenden CUA-Funkt. 89 | 90 | 91 | X_HEADER 92 | P 93 | Kontrollblocktabelle für die Tabelle 94 | 95 | 96 | X_NAMTAB 97 | P 98 | Kontrollblocktabelle für die Tabellen-Felder 99 | 100 | 101 | MISSING_CORR_NUMBER 102 | X 103 | Korrekturnummer fehlt 104 | 105 | 106 | 107 | 108 | TABLEPROC_ZALE_CONFIG_MP 109 | X 110 | Lower-level extended table maintenance 111 | 112 | 113 | FCODE 114 | 'RDED' 115 | 116 | 117 | VIEW_ACTION 118 | 'S' 119 | 120 | 121 | VIEW_NAME 122 | DD02V-TABNAME 123 | 124 | 125 | CORR_NUMBER 126 | E070-TRKORR 127 | ' ' 128 | 129 | 130 | 131 | 132 | LAST_ACT_ENTRY 133 | 134 | 135 | UCOMM 136 | 137 | 138 | UPDATE_REQUIRED 139 | 140 | 141 | 142 | 143 | CORR_KEYTAB 144 | E071K 145 | 146 | 147 | DBA_SELLIST 148 | VIMSELLIST 149 | 150 | 151 | DPL_SELLIST 152 | VIMSELLIST 153 | 154 | 155 | EXCL_CUA_FUNCT 156 | VIMEXCLFUN 157 | 158 | 159 | EXTRACT 160 | 161 | 162 | TOTAL 163 | 164 | 165 | X_HEADER 166 | VIMDESC 167 | 168 | 169 | X_NAMTAB 170 | VIMNAMTAB 171 | 172 | 173 | 174 | 175 | MISSING_CORR_NUMBER 176 | 177 | 178 | SAVING_CORRECTION_FAILED 179 | 180 | 181 | 182 | 183 | FCODE 184 | P 185 | gewünschte Funktion des Bausteins 186 | 187 | 188 | VIEW_ACTION 189 | P 190 | Aktion mit Tabelle: anz./änd./transp. (S/U/T) 191 | 192 | 193 | VIEW_NAME 194 | P 195 | Name der Tabelle 196 | 197 | 198 | CORR_NUMBER 199 | P 200 | Korrekturnummer für durchgeführte Änderungen 201 | 202 | 203 | LAST_ACT_ENTRY 204 | P 205 | Index der Cursorposition in der Anzeigetabelle 206 | 207 | 208 | UCOMM 209 | P 210 | letztes User-command innerhalb der Viewpflege 211 | 212 | 213 | UPDATE_REQUIRED 214 | P 215 | Flag: Einträge verändert, Sichern erforderlich 216 | 217 | 218 | CORR_KEYTAB 219 | P 220 | Tabelle mit den Keys der zu transport. Einträge 221 | 222 | 223 | DBA_SELLIST 224 | P 225 | Selektionsbedingungen für den DB-Zugriff 226 | 227 | 228 | DPL_SELLIST 229 | P 230 | Selektionsbedingungen für die Anzeige 231 | 232 | 233 | EXCL_CUA_FUNCT 234 | P 235 | Tab. der nicht zu aktivierenden CUA-Funktionen 236 | 237 | 238 | EXTRACT 239 | P 240 | Tab. der gerade sichtbaren Daten (Anzeigetabelle 241 | 242 | 243 | TOTAL 244 | P 245 | Tabelle, mit allen von der DB gelesenen Daten 246 | 247 | 248 | X_HEADER 249 | P 250 | Kontrollblocktabelle für die Tabelle 251 | 252 | 253 | X_NAMTAB 254 | P 255 | Kontrollblocktabelle für die Tabellen-Felder 256 | 257 | 258 | MISSING_CORR_NUMBER 259 | X 260 | Korrekturnummer fehlt 261 | 262 | 263 | SAVING_CORRECTION_FAILED 264 | X 265 | Fehler beim Sichern der Korrektureinträge 266 | 267 | 268 | 269 | 270 | 271 | 272 |
273 | SAPLZALE_CONFIG_MP 274 | 0001 275 | E 276 | View Maintenance: Overview Screen ZALE_CONFIG 277 | N 278 | 0001 279 | 061 280 | 255 281 |
282 | 283 | 284 | SCREEN 285 | SCREEN 286 | 287 | 288 | TABLE_CTRL 289 | TCTRL_ZALE_CONFIG 290 | SCREEN 291 | 001 292 | 001 293 | 255 294 | 059 295 | X 296 | X 297 | X 298 | X 299 | ENTRY 300 | X 301 | X 302 | X 303 | X 304 | X 305 | MULTIPLE 306 | NONE 307 | X 308 | 001 309 | 310 | 311 | 312 | 313 | SCREEN 314 | SCREEN 315 | PUSH_TMPL 316 | VIM_POSI_PUSH 317 | ____________________ 318 | 061 319 | 019 320 | 020 321 | 020 322 | 001 323 | POSI 324 | CHAR 325 | X 326 | N 327 | 328 | 329 | SCREEN 330 | SCREEN 331 | TEMPLATE 332 | VIM_POSITION_INFO 333 | ______________________________ 334 | 061 335 | 040 336 | 030 337 | 030 338 | 001 339 | CHAR 340 | X 341 | X 342 | X 343 | N 344 | <_--32_DIMENS>X 345 | 346 | 347 | SCREEN 348 | SCREEN 349 | OKCODE 350 | OK_CODE 351 | ____________________ 352 | 020 353 | 020 354 | 001 355 | CHAR 356 | X 357 | 358 | 359 | TABLE_CTRL 360 | TCTRL_ZALE_CONFIG 361 | TEMPLATE 362 | VIM_FRAME_FIELD 363 | ____________________________________________________________ 364 | 001 365 | 060 366 | 060 367 | 001 368 | CHAR 369 | X 370 | X 371 | N 372 | X 373 | 374 | 375 | TABLE_CTRL 376 | TCTRL_ZALE_CONFIG 377 | TEXT 378 | *ZALE_CONFIG-LOG_SCENARIO 379 | Scenario________________________________ 380 | 001 381 | 001 382 | 040 383 | 020 384 | 001 385 | CHAR 386 | X 387 | V 388 | N 389 | X 390 | 391 | 392 | TABLE_CTRL 393 | TCTRL_ZALE_CONFIG 394 | TEXT 395 | *ZALE_CONFIG-READER_CLASS 396 | reader_class____________________________ 397 | 001 398 | 002 399 | 040 400 | 030 401 | 001 402 | CHAR 403 | X 404 | V 405 | N 406 | X 407 | 408 | 409 | TABLE_CTRL 410 | TCTRL_ZALE_CONFIG 411 | TEXT 412 | *ZALE_CONFIG-CONVERTER_CLASS 413 | converter_class_________________________ 414 | 001 415 | 003 416 | 040 417 | 030 418 | 001 419 | CHAR 420 | X 421 | V 422 | N 423 | X 424 | 425 | 426 | TABLE_CTRL 427 | TCTRL_ZALE_CONFIG 428 | TEXT 429 | *ZALE_CONFIG-CONNECTOR_CLASS 430 | connector_class_________________________ 431 | 001 432 | 004 433 | 040 434 | 030 435 | 001 436 | CHAR 437 | X 438 | V 439 | N 440 | X 441 | 442 | 443 | TABLE_CTRL 444 | TCTRL_ZALE_CONFIG 445 | TEXT 446 | *ZALE_CONFIG-CONNECTOR_URL 447 | connector_url___________________________ 448 | 001 449 | 005 450 | 040 451 | 255 452 | 001 453 | CHAR 454 | X 455 | V 456 | N 457 | X 458 | 459 | 460 | TABLE_CTRL 461 | TCTRL_ZALE_CONFIG 462 | CHECK 463 | VIM_MARKED 464 | 001 465 | 001 466 | 001 467 | 001 468 | CHAR 469 | X 470 | X 471 | X 472 | 473 | 474 | TABLE_CTRL 475 | TCTRL_ZALE_CONFIG 476 | TEMPLATE 477 | ZALE_CONFIG-LOG_SCENARIO 478 | ____________________ 479 | 001 480 | 001 481 | 020 482 | 020 483 | 001 484 | KEY 485 | CHAR 486 | X 487 | X 488 | X 489 | X 490 | N 491 | 492 | 493 | TABLE_CTRL 494 | TCTRL_ZALE_CONFIG 495 | TEMPLATE 496 | ZALE_CONFIG-READER_CLASS 497 | ______________________________ 498 | 001 499 | 002 500 | 030 501 | 030 502 | 001 503 | CHAR 504 | X 505 | X 506 | X 507 | X 508 | 509 | 510 | TABLE_CTRL 511 | TCTRL_ZALE_CONFIG 512 | TEMPLATE 513 | ZALE_CONFIG-CONVERTER_CLASS 514 | ______________________________ 515 | 001 516 | 003 517 | 030 518 | 030 519 | 001 520 | CHAR 521 | X 522 | X 523 | X 524 | X 525 | 526 | 527 | TABLE_CTRL 528 | TCTRL_ZALE_CONFIG 529 | TEMPLATE 530 | ZALE_CONFIG-CONNECTOR_CLASS 531 | ______________________________ 532 | 001 533 | 004 534 | 030 535 | 030 536 | 001 537 | CHAR 538 | X 539 | X 540 | X 541 | X 542 | 543 | 544 | TABLE_CTRL 545 | TCTRL_ZALE_CONFIG 546 | TEMPLATE 547 | ZALE_CONFIG-CONNECTOR_URL 548 | ____________________________________________________________________________________________________________________________________ 549 | 001 550 | 005 551 | 255 552 | 255 553 | 001 554 | CHAR 555 | X 556 | X 557 | X 558 | X 559 | X 560 | 561 | 562 | 563 | 564 | PROCESS BEFORE OUTPUT. 565 | 566 | 567 | MODULE LISTE_INITIALISIEREN. 568 | 569 | 570 | LOOP AT EXTRACT WITH CONTROL 571 | 572 | 573 | TCTRL_ZALE_CONFIG CURSOR NEXTLINE. 574 | 575 | 576 | MODULE LISTE_SHOW_LISTE. 577 | 578 | 579 | ENDLOOP. 580 | 581 | 582 | * 583 | 584 | 585 | PROCESS AFTER INPUT. 586 | 587 | 588 | MODULE LISTE_EXIT_COMMAND AT EXIT-COMMAND. 589 | 590 | 591 | MODULE LISTE_BEFORE_LOOP. 592 | 593 | 594 | LOOP AT EXTRACT. 595 | 596 | 597 | MODULE LISTE_INIT_WORKAREA. 598 | 599 | 600 | CHAIN. 601 | 602 | 603 | FIELD ZALE_CONFIG-LOG_SCENARIO . 604 | 605 | 606 | FIELD ZALE_CONFIG-READER_CLASS . 607 | 608 | 609 | FIELD ZALE_CONFIG-CONVERTER_CLASS . 610 | 611 | 612 | FIELD ZALE_CONFIG-CONNECTOR_CLASS . 613 | 614 | 615 | FIELD ZALE_CONFIG-CONNECTOR_URL . 616 | 617 | 618 | MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST. 619 | 620 | 621 | ENDCHAIN. 622 | 623 | 624 | FIELD VIM_MARKED MODULE LISTE_MARK_CHECKBOX. 625 | 626 | 627 | CHAIN. 628 | 629 | 630 | FIELD ZALE_CONFIG-LOG_SCENARIO . 631 | 632 | 633 | MODULE LISTE_UPDATE_LISTE. 634 | 635 | 636 | ENDCHAIN. 637 | 638 | 639 | ENDLOOP. 640 | 641 | 642 | MODULE LISTE_AFTER_LOOP. 643 | 644 | 645 |
646 | 647 |
648 | SAPLZALE_CONFIG_MP 649 | 0002 650 | E 651 | View Maintenance: Detail Screen ZALE_CONFIG 652 | N 653 | 0002 654 | 061 655 | 255 656 |
657 | 658 | 659 | SCREEN 660 | SCREEN 661 | 662 | 663 | 664 | 665 | SCREEN 666 | SCREEN 667 | TEXT 668 | ZALE_CONFIG-LOG_SCENARIO 669 | Scenario 670 | 001 671 | 001 672 | 008 673 | 008 674 | 001 675 | CHAR 676 | X 677 | 2 678 | N 679 | X 680 | 681 | 682 | SCREEN 683 | SCREEN 684 | TEMPLATE 685 | ZALE_CONFIG-LOG_SCENARIO 686 | ____________________ 687 | 001 688 | 010 689 | 020 690 | 020 691 | 001 692 | KEY 693 | CHAR 694 | X 695 | X 696 | X 697 | N 698 | 699 | 700 | SCREEN 701 | SCREEN 702 | FRAME_TMPL 703 | VIM_FRAME_FIELD 704 | ____________________________________________________________________________________________________________________________________ 705 | 003 706 | 001 707 | 254 708 | 254 709 | 006 710 | CHAR 711 | X 712 | X 713 | N 714 | 715 | 716 | SCREEN 717 | SCREEN 718 | TEXT 719 | ZALE_CONFIG-READER_CLASS 720 | reader_class________ 721 | 004 722 | 002 723 | 020 724 | 020 725 | 001 726 | CHAR 727 | X 728 | 2 729 | N 730 | X 731 | 732 | 733 | SCREEN 734 | SCREEN 735 | TEMPLATE 736 | ZALE_CONFIG-READER_CLASS 737 | ______________________________ 738 | 004 739 | 023 740 | 030 741 | 030 742 | 001 743 | CHAR 744 | X 745 | X 746 | X 747 | 748 | 749 | SCREEN 750 | SCREEN 751 | TEXT 752 | ZALE_CONFIG-CONVERTER_CLASS 753 | converter_class_____ 754 | 005 755 | 002 756 | 020 757 | 020 758 | 001 759 | CHAR 760 | X 761 | 2 762 | N 763 | X 764 | 765 | 766 | SCREEN 767 | SCREEN 768 | TEMPLATE 769 | ZALE_CONFIG-CONVERTER_CLASS 770 | ______________________________ 771 | 005 772 | 023 773 | 030 774 | 030 775 | 001 776 | CHAR 777 | X 778 | X 779 | X 780 | 781 | 782 | SCREEN 783 | SCREEN 784 | TEXT 785 | ZALE_CONFIG-CONNECTOR_CLASS 786 | connector_class_____ 787 | 006 788 | 002 789 | 020 790 | 020 791 | 001 792 | CHAR 793 | X 794 | 2 795 | N 796 | X 797 | 798 | 799 | SCREEN 800 | SCREEN 801 | TEMPLATE 802 | ZALE_CONFIG-CONNECTOR_CLASS 803 | ______________________________ 804 | 006 805 | 023 806 | 030 807 | 030 808 | 001 809 | CHAR 810 | X 811 | X 812 | X 813 | 814 | 815 | SCREEN 816 | SCREEN 817 | TEXT 818 | ZALE_CONFIG-CONNECTOR_URL 819 | connector_url_______ 820 | 007 821 | 002 822 | 020 823 | 020 824 | 001 825 | CHAR 826 | X 827 | 2 828 | N 829 | X 830 | 831 | 832 | SCREEN 833 | SCREEN 834 | TEMPLATE 835 | ZALE_CONFIG-CONNECTOR_URL 836 | ____________________________________________________________________________________________________________________________________ 837 | X 838 | 007 839 | 023 840 | 255 841 | 231 842 | 001 843 | CHAR 844 | X 845 | X 846 | X 847 | X 848 | X 849 | 850 | 851 | SCREEN 852 | SCREEN 853 | OKCODE 854 | OK_CODE 855 | ____________________ 856 | 020 857 | 020 858 | 001 859 | CHAR 860 | X 861 | 862 | 863 | 864 | 865 | PROCESS BEFORE OUTPUT. 866 | 867 | 868 | MODULE detail_init. 869 | 870 | 871 | * 872 | 873 | 874 | PROCESS AFTER INPUT. 875 | 876 | 877 | MODULE DETAIL_EXIT_COMMAND AT EXIT-COMMAND. 878 | 879 | 880 | MODULE DETAIL_SET_PFSTATUS. 881 | 882 | 883 | CHAIN. 884 | 885 | 886 | FIELD ZALE_CONFIG-LOG_SCENARIO . 887 | 888 | 889 | FIELD ZALE_CONFIG-READER_CLASS . 890 | 891 | 892 | FIELD ZALE_CONFIG-CONVERTER_CLASS . 893 | 894 | 895 | FIELD ZALE_CONFIG-CONNECTOR_CLASS . 896 | 897 | 898 | FIELD ZALE_CONFIG-CONNECTOR_URL . 899 | 900 | 901 | MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST. 902 | 903 | 904 | endchain. 905 | 906 | 907 | chain. 908 | 909 | 910 | FIELD ZALE_CONFIG-LOG_SCENARIO . 911 | 912 | 913 | module detail_pai. 914 | 915 | 916 | endchain. 917 | 918 | 919 |
920 |
921 |
922 |
923 |
924 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_configs.tobj.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZALE_CONFIG 7 | S 8 | CUSY 9 | 3 10 | 11 | 12 | E 13 | ZALE_CONFIG 14 | S 15 | abap-log-exporter configuration 16 | 17 | 18 | 19 | ZALE_CONFIG 20 | S 21 | ZALE_CONFIG 22 | X 23 | X 24 | 25 | 26 | 27 | 28 | ZALE_CONFIG 29 | &NC& 30 | 31 | 32 | ZALE_CONFIG 33 | ZALE_CONFIG_MP 34 | 2 35 | 0001 36 | 0002 37 | X 38 | X 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_connector_class.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZALE_CONNECTOR_CLASS 7 | E 8 | SEOCLSNAME 9 | 55 10 | 10 11 | 20 12 | 40 13 | connector class 14 | connector class 15 | connector 16 | connector class 17 | connector class 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_connector_url.doma.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZALE_CONNECTOR_URL 7 | E 8 | CHAR 9 | 000255 10 | 000255 11 | X 12 | connector url 13 | E 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_connector_url.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZALE_CONNECTOR_URL 7 | E 8 | ZALE_CONNECTOR_URL 9 | 55 10 | 10 11 | 20 12 | 40 13 | connector url 14 | connector url 15 | url 16 | connector url 17 | connector ur 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_converter_class.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZALE_CONVERTER_CLASS 7 | E 8 | SEOCLSNAME 9 | 55 10 | 10 11 | 20 12 | 40 13 | converter class 14 | converter class 15 | converter 16 | converter class 17 | converter class 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_log_scenario.doma.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZALE_LOG_SCENARIO 7 | E 8 | CHAR 9 | 000020 10 | 000020 11 | X 12 | ale log scenario 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_log_scenario.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZALE_LOG_SCENARIO 7 | E 8 | ZALE_LOG_SCENARIO 9 | 08 10 | 08 11 | 08 12 | 08 13 | ale log scenario 14 | Scenario 15 | Scenario 16 | Scenario 17 | Scenario 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zale_customizing/zale_reader_class.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZALE_READER_CLASS 7 | E 8 | SEOCLSNAME 9 | 55 10 | 10 11 | 20 12 | 40 13 | reader class 14 | reader class 15 | reader 16 | reader class 17 | reader class 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zale_customizing/zcl_ale_customizing.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_ale_customizing DEFINITION PUBLIC ABSTRACT. 2 | PUBLIC SECTION. 3 | 4 | METHODS constructor 5 | IMPORTING scenario TYPE zale_config-log_scenario. 6 | 7 | METHODS get_reader_class ABSTRACT 8 | RETURNING VALUE(reader_class) TYPE REF TO zif_ale_log_reader. 9 | 10 | METHODS get_converter_class ABSTRACT 11 | RETURNING VALUE(converter_class) TYPE REF TO zif_ale_log_converter. 12 | 13 | METHODS get_connector_class ABSTRACT 14 | RETURNING VALUE(connector_class) TYPE REF TO zif_ale_log_connector. 15 | 16 | METHODS get_connector_url ABSTRACT 17 | RETURNING VALUE(connector_url) TYPE zale_config-connector_url. 18 | 19 | PROTECTED SECTION. 20 | 21 | DATA scenario TYPE zale_config-log_scenario. 22 | DATA configuration TYPE zale_config. 23 | 24 | PRIVATE SECTION. 25 | 26 | METHODS set_scenario 27 | IMPORTING scenario TYPE zale_config-log_scenario. 28 | 29 | ENDCLASS. 30 | 31 | CLASS zcl_ale_customizing IMPLEMENTATION. 32 | METHOD constructor. 33 | 34 | me->set_scenario( scenario ). 35 | 36 | ENDMETHOD. 37 | 38 | METHOD set_scenario. 39 | 40 | me->scenario = scenario. 41 | 42 | SELECT SINGLE * 43 | FROM zale_config 44 | INTO @configuration 45 | WHERE log_scenario = @scenario. 46 | 47 | ENDMETHOD. 48 | 49 | ENDCLASS. 50 | -------------------------------------------------------------------------------- /src/zale_customizing/zcl_ale_customizing.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ALE_CUSTOMIZING 7 | E 8 | Abstract class for ale customizing 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zale_customizing/zcl_ale_customizing_base.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_ale_customizing_base DEFINITION INHERITING FROM zcl_ale_customizing 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | METHODS get_reader_class REDEFINITION. 9 | METHODS get_converter_class REDEFINITION. 10 | METHODS get_connector_class REDEFINITION. 11 | METHODS get_connector_url REDEFINITION. 12 | 13 | PROTECTED SECTION. 14 | 15 | PRIVATE SECTION. 16 | 17 | ENDCLASS. 18 | 19 | CLASS zcl_ale_customizing_base IMPLEMENTATION. 20 | METHOD get_connector_class. 21 | DATA(connector_class_name) = configuration-connector_class. 22 | TRANSLATE connector_class_name TO UPPER CASE. 23 | CREATE OBJECT connector_class TYPE (connector_class_name). 24 | ENDMETHOD. 25 | 26 | METHOD get_connector_url. 27 | connector_url = configuration-connector_url. 28 | ENDMETHOD. 29 | 30 | METHOD get_converter_class. 31 | DATA(converter_class_name) = configuration-converter_class. 32 | TRANSLATE converter_class_name TO UPPER CASE. 33 | CREATE OBJECT converter_class TYPE (converter_class_name). 34 | ENDMETHOD. 35 | 36 | METHOD get_reader_class. 37 | DATA(reader_class_name) = configuration-reader_class. 38 | TRANSLATE reader_class_name TO UPPER CASE. 39 | CREATE OBJECT reader_class TYPE (reader_class_name). 40 | ENDMETHOD. 41 | 42 | ENDCLASS. 43 | -------------------------------------------------------------------------------- /src/zale_customizing/zcl_ale_customizing_base.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ALE_CUSTOMIZING_BASE 7 | E 8 | ale customizing 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zale_example.prog.abap: -------------------------------------------------------------------------------- 1 | REPORT zale_example. 2 | 3 | PARAMETERS loki AS CHECKBOX. 4 | PARAMETERS gelf AS CHECKBOX. 5 | 6 | 7 | CONSTANTS object_abe_example TYPE balobj_d VALUE 'ZALE'. 8 | CONSTANTS subobject_abe_example TYPE balsubobj VALUE 'ZALE_EXAMPLE'. 9 | 10 | CONSTANTS gelf_url TYPE zale_config-ale_key VALUE 'GELF_URL'. 11 | CONSTANTS loki_url TYPE zale_config-ale_key VALUE 'LOKI_URL'. 12 | 13 | START-OF-SELECTION. 14 | 15 | "load config 16 | SELECT * 17 | FROM zale_config 18 | INTO TABLE @DATA(configurations). 19 | 20 | 21 | "log to BAL 22 | DATA log_handle TYPE balloghndl. 23 | DATA log_entry_header TYPE bal_s_log. 24 | 25 | log_entry_header-extnumber = 'BAL export example'. 26 | log_entry_header-object = object_abe_example. 27 | log_entry_header-subobject = subobject_abe_example. 28 | log_entry_header-aldate = sy-datum. 29 | log_entry_header-altime = sy-uzeit. 30 | log_entry_header-aluser = sy-uname. 31 | log_entry_header-alprog = sy-repid. 32 | 33 | CALL FUNCTION 'BAL_LOG_CREATE' 34 | EXPORTING 35 | i_s_log = log_entry_header 36 | IMPORTING 37 | e_log_handle = log_handle 38 | EXCEPTIONS 39 | log_header_inconsistent = 1 40 | OTHERS = 2. 41 | 42 | IF sy-subrc = 0. 43 | 44 | CALL FUNCTION 'BAL_LOG_MSG_ADD_FREE_TEXT' 45 | EXPORTING 46 | i_log_handle = log_handle 47 | i_msgty = 'I' 48 | i_text = 'example warning' 49 | EXCEPTIONS 50 | log_not_found = 1 51 | msg_inconsistent = 2 52 | log_is_full = 3 53 | OTHERS = 4. 54 | IF sy-subrc <> 0. 55 | MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno 56 | WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 57 | ENDIF. 58 | 59 | CALL FUNCTION 'BAL_LOG_MSG_ADD_FREE_TEXT' 60 | EXPORTING 61 | i_log_handle = log_handle 62 | i_msgty = 'I' 63 | i_text = 'example error' 64 | EXCEPTIONS 65 | log_not_found = 1 66 | msg_inconsistent = 2 67 | log_is_full = 3 68 | OTHERS = 4. 69 | IF sy-subrc <> 0. 70 | MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno 71 | WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 72 | ENDIF. 73 | 74 | CALL FUNCTION 'BAL_DB_SAVE' 75 | EXPORTING 76 | i_save_all = 'X' 77 | EXCEPTIONS 78 | log_not_found = 1 79 | save_not_allowed = 2 80 | numbering_error = 3 81 | OTHERS = 4. 82 | 83 | IF sy-subrc <> 0. 84 | MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno 85 | WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 86 | ENDIF. 87 | 88 | 89 | ELSE. 90 | MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno 91 | WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 92 | ENDIF. 93 | 94 | "read from BAL 95 | 96 | DATA header_data TYPE STANDARD TABLE OF balhdr. 97 | DATA header_parameters TYPE STANDARD TABLE OF balhdrp. 98 | DATA messages TYPE STANDARD TABLE OF balm. 99 | DATA message_parameters TYPE STANDARD TABLE OF balmp. 100 | DATA contexts TYPE STANDARD TABLE OF balc. 101 | DATA exceptions TYPE STANDARD TABLE OF bal_s_exception. 102 | 103 | 104 | CALL FUNCTION 'APPL_LOG_READ_DB' 105 | EXPORTING 106 | object = object_abe_example 107 | subobject = subobject_abe_example 108 | date_from = sy-datum 109 | date_to = sy-datum 110 | TABLES 111 | header_data = header_data 112 | header_parameters = header_parameters 113 | messages = messages 114 | message_parameters = message_parameters 115 | contexts = contexts 116 | t_exceptions = exceptions. 117 | 118 | LOOP AT header_data INTO DATA(header_data_wa). 119 | 120 | LOOP AT messages INTO DATA(message) WHERE lognumber = header_data_wa-lognumber. 121 | 122 | "convert to GELF and Loki 123 | 124 | DATA(gelf_json) = |\{| && 125 | |"version": "1.1",| && 126 | |"host": "{ sy-host }",| && 127 | |"short_message": "{ header_data_wa-extnumber }",| && 128 | |"full_message": "{ message-msgv1 }",| && 129 | |"level": 1,| && 130 | |"_user_id": "{ header_data_wa-aluser }",| && 131 | |"_some_info": "foo",| && 132 | |"_some_env_var": "bar"| && 133 | |\}|. 134 | 135 | 136 | DATA time TYPE c LENGTH 8. 137 | DATA timestamp TYPE timestamp. 138 | "rework necessary 139 | CONVERT DATE header_data_wa-aldate TIME header_data_wa-altime INTO TIME STAMP timestamp TIME ZONE 'CST'. 140 | CONVERT TIME STAMP timestamp TIME ZONE 'CST' INTO DATE header_data_wa-aldate TIME header_data_wa-altime. 141 | 142 | WRITE header_data_wa-altime TO time USING EDIT MASK '__:__:__'. 143 | 144 | DATA(date) = |{ header_data_wa-aldate DATE = ISO }|. 145 | 146 | * data(label) 147 | 148 | DATA(loki_json) = |\{"streams": [| && 149 | |\{ "labels": "\{BALexport=\\"{ header_data_wa-extnumber }\\"\}",| && 150 | | "entries": [\{ "ts": "{ date }T{ time }.801064",| && 151 | | "line": "{ message-msgv1 }" \}] \}]\}|. 152 | 153 | 154 | TYPES: BEGIN OF export_target, 155 | url TYPE string, 156 | json TYPE string, 157 | END OF export_target. 158 | 159 | DATA export_targets TYPE STANDARD TABLE OF export_target. 160 | DATA export_target LIKE LINE OF export_targets. 161 | 162 | "export to GELF and Loki 163 | IF gelf = abap_true. 164 | export_target-url = configurations[ ale_key = gelf_url ]-ale_value. 165 | export_target-json = gelf_json. 166 | APPEND export_target TO export_targets. 167 | ENDIF. 168 | 169 | IF loki = abap_true. 170 | export_target-url = configurations[ ale_key = loki_url ]-ale_value. 171 | export_target-json = loki_json. 172 | APPEND export_target TO export_targets. 173 | ENDIF. 174 | 175 | LOOP AT export_targets INTO export_target. 176 | 177 | 178 | cl_http_client=>create_by_url( 179 | EXPORTING 180 | url = export_target-url 181 | IMPORTING 182 | client = DATA(client) 183 | EXCEPTIONS 184 | argument_not_found = 1 185 | plugin_not_active = 2 186 | internal_error = 3 187 | OTHERS = 4 ). 188 | IF sy-subrc <> 0. 189 | ASSERT 1 = 2. 190 | ENDIF. 191 | 192 | client->request->set_method( 'POST' ). 193 | client->request->set_content_type( 'application/json' ). 194 | 195 | DATA xjson TYPE xstring. 196 | 197 | CALL FUNCTION 'SCMS_STRING_TO_XSTRING' 198 | EXPORTING 199 | text = export_target-json 200 | * mimetype = SPACE 201 | * encoding = 202 | IMPORTING 203 | buffer = xjson 204 | EXCEPTIONS 205 | failed = 1 206 | OTHERS = 2. 207 | IF sy-subrc <> 0. 208 | MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno 209 | WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 210 | ENDIF. 211 | 212 | client->request->set_data( xjson ). 213 | 214 | client->send( 215 | EXCEPTIONS 216 | http_communication_failure = 1 217 | http_invalid_state = 2 218 | http_processing_failed = 3 219 | http_invalid_timeout = 4 220 | OTHERS = 5 ). 221 | IF sy-subrc <> 0. 222 | ASSERT 1 = 2. 223 | ENDIF. 224 | 225 | client->receive( 226 | EXCEPTIONS 227 | http_communication_failure = 1 228 | http_invalid_state = 2 229 | http_processing_failed = 3 230 | OTHERS = 4 ). 231 | IF sy-subrc <> 0. 232 | ASSERT 1 = 2. 233 | ENDIF. 234 | 235 | client->response->get_status( IMPORTING 236 | code = DATA(http_code) 237 | reason = DATA(reason) ). 238 | 239 | ENDLOOP. 240 | 241 | ENDLOOP. 242 | ENDLOOP. 243 | 244 | sy-subrc = sy-subrc. 245 | -------------------------------------------------------------------------------- /src/zale_example.prog.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZALE_EXAMPLE 7 | 1 8 | E 9 | X 10 | X 11 | 12 | 13 | 14 | R 15 | ale example 16 | 11 17 | 18 | 19 | S 20 | GELF 21 | GELF 22 | 12 23 | 24 | 25 | S 26 | LOKI 27 | Loki 28 | 12 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/zale_example_bal_log_creator.prog.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Report zale_example_bal_log_creator 3 | *&---------------------------------------------------------------------* 4 | *& 5 | *&---------------------------------------------------------------------* 6 | REPORT zale_example_bal_log_creator. 7 | 8 | PARAMETERS object TYPE balhdr-object OBLIGATORY. 9 | PARAMETERS suobject TYPE balhdr-subobject OBLIGATORY. 10 | PARAMETERS message TYPE char40 OBLIGATORY. 11 | 12 | START-OF-SELECTION. 13 | 14 | "log to BAL 15 | DATA log_handle TYPE balloghndl. 16 | DATA log_entry_header TYPE bal_s_log. 17 | 18 | log_entry_header-extnumber = 'BAL export example'. 19 | log_entry_header-object = object. 20 | log_entry_header-subobject = suobject. 21 | log_entry_header-aldate = sy-datum. 22 | log_entry_header-altime = sy-uzeit. 23 | log_entry_header-aluser = sy-uname. 24 | log_entry_header-alprog = sy-repid. 25 | 26 | CALL FUNCTION 'BAL_LOG_CREATE' 27 | EXPORTING 28 | i_s_log = log_entry_header 29 | IMPORTING 30 | e_log_handle = log_handle 31 | EXCEPTIONS 32 | log_header_inconsistent = 1 33 | OTHERS = 2. 34 | 35 | IF sy-subrc = 0. 36 | 37 | CALL FUNCTION 'BAL_LOG_MSG_ADD_FREE_TEXT' 38 | EXPORTING 39 | i_log_handle = log_handle 40 | i_msgty = 'I' 41 | i_text = message 42 | EXCEPTIONS 43 | log_not_found = 1 44 | msg_inconsistent = 2 45 | log_is_full = 3 46 | OTHERS = 4. 47 | IF sy-subrc <> 0. 48 | MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno 49 | WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 50 | ENDIF. 51 | 52 | CALL FUNCTION 'BAL_DB_SAVE' 53 | EXPORTING 54 | i_save_all = 'X' 55 | EXCEPTIONS 56 | log_not_found = 1 57 | save_not_allowed = 2 58 | numbering_error = 3 59 | OTHERS = 4. 60 | 61 | IF sy-subrc <> 0. 62 | MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno 63 | WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 64 | ENDIF. 65 | 66 | 67 | ELSE. 68 | MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno 69 | WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 70 | ENDIF. 71 | -------------------------------------------------------------------------------- /src/zale_example_bal_log_creator.prog.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZALE_EXAMPLE_BAL_LOG_CREATOR 7 | S 8 | 1 9 | X 10 | D$S 11 | X 12 | 13 | 14 | 15 | R 16 | Create bal logs 17 | 15 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/zale_example_configuration.scp1.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | ZALE_EXAMPLE_CONFIGURATION 8 | TMV 9 | TRAN 10 | NPLK900076 11 | /CUSTOMER/ 12 | SAP_BASIS 13 | 752 14 | * 15 | 16 | 17 | 18 | E 19 | ZALE_EXAMPLE_CONFIGURATION 20 | N 21 | ale example 22 | 23 | 24 | 25 | 26 | ZALE_EXAMPLE_CONFIGURATION 27 | N 28 | BALOBJ 29 | 1 30 | OBJECT 31 | FKY 32 | ZALE 33 | 34 | 35 | ZALE_EXAMPLE_CONFIGURATION 36 | N 37 | V_BALSUB 38 | 1 39 | OBJECT 40 | FKY 41 | ZALE 42 | 43 | 44 | ZALE_EXAMPLE_CONFIGURATION 45 | N 46 | V_BALSUB 47 | 1 48 | SUBOBJECT 49 | FKY 50 | ZALE_EXAMPLE 51 | 52 | 53 | 54 | 55 | ZALE_EXAMPLE_CONFIGURATION 56 | N 57 | BALOBJ 58 | 1 59 | OBJTXT 60 | E 61 | USE 62 | abap-log-exporter 63 | 64 | 65 | ZALE_EXAMPLE_CONFIGURATION 66 | N 67 | V_BALSUB 68 | 1 69 | SUBOBJTXT 70 | E 71 | USE 72 | ale example 73 | 74 | 75 | 76 | 77 | ZALE_EXAMPLE_CONFIGURATION 78 | N 79 | BALOBJ 80 | 1 81 | APPL_LOG 82 | C 83 | APPL_LOG 84 | 85 | 86 | ZALE_EXAMPLE_CONFIGURATION 87 | N 88 | V_BALSUB 89 | 1 90 | APPL_LOG 91 | C 92 | APPL_LOG 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /src/zale_export_log_bal.prog.abap: -------------------------------------------------------------------------------- 1 | *&---------------------------------------------------------------------* 2 | *& Report ZALE_EXPORT_LOG_BAL 3 | *&---------------------------------------------------------------------* 4 | *& 5 | *&---------------------------------------------------------------------* 6 | REPORT zale_export_log_bal. 7 | 8 | TABLES balhdr. 9 | 10 | PARAMETERS scenario TYPE zale_config-log_scenario OBLIGATORY. 11 | SELECT-OPTIONS object FOR balhdr-object. 12 | SELECT-OPTIONS suobject FOR balhdr-subobject. 13 | PARAMETERS lastsec TYPE i. 14 | PARAMETERS fromdat TYPE dats. 15 | PARAMETERS fromtim TYPE tims. 16 | PARAMETERS todat TYPE dats. 17 | PARAMETERS totim TYPE tims. 18 | PARAMETERS test TYPE flag DEFAULT 'X'. 19 | 20 | INITIALIZATION. 21 | 22 | fromdat = sy-datum. 23 | fromtim = sy-uzeit - 900. " 15 minutes 24 | todat = sy-datum. 25 | totim = sy-uzeit. 26 | 27 | START-OF-SELECTION. 28 | 29 | DATA filter_values TYPE zif_ale_log_reader=>ty_filter_values. 30 | 31 | 32 | IF lastsec IS NOT INITIAL. 33 | fromdat = sy-datum. 34 | fromtim = sy-uzeit - lastsec. 35 | todat = sy-datum. 36 | totim = sy-uzeit. 37 | ENDIF. 38 | 39 | 40 | filter_values = VALUE #( ( key = 'OBJECT' value = REF #( object[] ) ) 41 | ( key = 'SUBOBJECT' value = REF #( suobject[] ) ) 42 | ( key = 'LAST_SECONDS' value = REF #( lastsec ) ) 43 | ( key = 'DATE_FROM' value = REF #( fromdat ) ) 44 | ( key = 'TIME_FROM' value = REF #( fromtim ) ) 45 | ( key = 'DATE_TO' value = REF #( todat ) ) 46 | ( key = 'TIME_TO' value = REF #( totim ) ) ). 47 | 48 | "set customzing 49 | DATA(customizing) = NEW zcl_ale_customizing_base( scenario ). 50 | 51 | "read 52 | DATA(logs) = customizing->get_reader_class( )->read( filter_values = filter_values 53 | customizing = customizing ). 54 | 55 | "convert 56 | DATA(converted_logs) = customizing->get_converter_class( )->convert( logs = logs 57 | customizing = customizing ). 58 | 59 | "connect 60 | IF test = abap_true. 61 | cl_demo_output=>display( converted_logs ). 62 | ELSE. 63 | customizing->get_connector_class( )->connect( converted_logs = converted_logs 64 | customizing = customizing ). 65 | DATA(log_lines) = lines( converted_logs ). 66 | WRITE |Number of logs sent: { log_lines }|. 67 | ENDIF. 68 | -------------------------------------------------------------------------------- /src/zale_export_log_bal.prog.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZALE_EXPORT_LOG_BAL 7 | 1 8 | E 9 | X 10 | X 11 | 12 | 13 | 14 | R 15 | Exports the logs of BAL 16 | 23 17 | 18 | 19 | S 20 | FROMDAT 21 | from date 22 | 17 23 | 24 | 25 | S 26 | FROMTIM 27 | from time 28 | 17 29 | 30 | 31 | S 32 | LASTSEC 33 | search last in seconds 34 | 30 35 | 36 | 37 | S 38 | OBJECT 39 | . 40 | 9 41 | D 42 | 43 | 44 | S 45 | SCENARIO 46 | . 47 | 9 48 | D 49 | 50 | 51 | S 52 | SUOBJECT 53 | . 54 | 9 55 | D 56 | 57 | 58 | S 59 | TEST 60 | Test 61 | 12 62 | 63 | 64 | S 65 | TODAT 66 | to date 67 | 15 68 | 69 | 70 | S 71 | TOTIM 72 | to time 73 | 15 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /src/zale_reader/package.devc.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | reader of logs 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/zale_reader/zcl_ale_log_reader_bal.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_ale_log_reader_bal DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | INTERFACES zif_ale_log_reader. 9 | 10 | PROTECTED SECTION. 11 | PRIVATE SECTION. 12 | ENDCLASS. 13 | CLASS zcl_ale_log_reader_bal IMPLEMENTATION. 14 | 15 | METHOD zif_ale_log_reader~read. 16 | 17 | DATA header_data TYPE STANDARD TABLE OF balhdr. 18 | DATA header_parameters TYPE STANDARD TABLE OF balhdrp. 19 | DATA messages TYPE STANDARD TABLE OF balm. 20 | DATA message_parameters TYPE STANDARD TABLE OF balmp. 21 | DATA contexts TYPE STANDARD TABLE OF balc. 22 | DATA exceptions TYPE STANDARD TABLE OF bal_s_exception. 23 | DATA log_entry TYPE string. 24 | 25 | FIELD-SYMBOLS TYPE STANDARD TABLE. 26 | FIELD-SYMBOLS TYPE STANDARD TABLE. 27 | 28 | DATA(object_ref) = filter_values[ key = 'OBJECT' ]-value. 29 | ASSIGN object_ref->* TO . 30 | 31 | DATA(subobject_ref) = filter_values[ key = 'SUBOBJECT' ]-value. 32 | ASSIGN subobject_ref->* TO . 33 | 34 | SELECT 35 | object, 36 | subobject 37 | FROM balsub 38 | INTO TABLE @DATA(objects) 39 | WHERE object IN @ 40 | AND subobject IN @. 41 | 42 | 43 | DATA(date_from_ref) = filter_values[ key = 'DATE_FROM' ]-value. 44 | ASSIGN date_from_ref->* TO FIELD-SYMBOL(). 45 | 46 | DATA(time_from_ref) = filter_values[ key = 'TIME_FROM' ]-value. 47 | ASSIGN time_from_ref->* TO FIELD-SYMBOL(). 48 | 49 | DATA(date_to_ref) = filter_values[ key = 'DATE_TO' ]-value. 50 | ASSIGN date_to_ref->* TO FIELD-SYMBOL(). 51 | 52 | DATA(time_to_ref) = filter_values[ key = 'TIME_TO' ]-value. 53 | ASSIGN time_to_ref->* TO FIELD-SYMBOL(). 54 | 55 | 56 | LOOP AT objects ASSIGNING FIELD-SYMBOL(). 57 | 58 | CLEAR header_data. 59 | CLEAR header_parameters. 60 | CLEAR messages. 61 | CLEAR message_parameters. 62 | CLEAR contexts. 63 | CLEAR exceptions. 64 | 65 | CALL FUNCTION 'APPL_LOG_READ_DB' 66 | EXPORTING 67 | object = -object 68 | subobject = -subobject 69 | * external_number = space " external number 70 | date_from = CONV baldate( ) 71 | date_to = CONV baldate( ) 72 | time_from = CONV baltime( ) 73 | time_to = CONV baltime( ) 74 | * log_class = '4' " Problem class 75 | * program_name = '*' " Program name 76 | * transaction_code = '*' " Transaction name 77 | * user_id = space " User name 78 | * mode = '+' " Operating mode 79 | * put_into_memory = space 80 | * IMPORTING 81 | * number_of_logs = " Number of logs read 82 | TABLES 83 | header_data = header_data 84 | header_parameters = header_parameters 85 | messages = messages 86 | message_parameters = message_parameters 87 | contexts = contexts 88 | t_exceptions = exceptions. 89 | 90 | LOOP AT header_data ASSIGNING FIELD-SYMBOL(). 91 | LOOP AT messages ASSIGNING FIELD-SYMBOL() WHERE lognumber = -lognumber. 92 | 93 | MESSAGE ID -msgid TYPE -msgty NUMBER -msgno 94 | WITH -msgv1 -msgv2 -msgv3 -msgv4 95 | INTO log_entry. 96 | 97 | DATA(additional_fields) = VALUE zif_ale_log_reader=>ty_additional_fields( ( field = 'object' value = -object ) 98 | ( field = 'subobject' value = -subobject ) ). 99 | 100 | 101 | logs = VALUE #( BASE logs ( level = -msgty 102 | header_text = |{ -extnumber } / { -object } / { -subobject }| 103 | item_text = log_entry 104 | timestamp = -tim_stmp 105 | additional_fields = additional_fields ) ). 106 | 107 | ENDLOOP. 108 | ENDLOOP. 109 | ENDLOOP. 110 | 111 | ENDMETHOD. 112 | 113 | ENDCLASS. 114 | -------------------------------------------------------------------------------- /src/zale_reader/zcl_ale_log_reader_bal.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ALE_LOG_READER_BAL 7 | E 8 | Log Reader BAL 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zale_reader/zcl_ale_log_reader_sm21.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_ale_log_reader_sm21 DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | INTERFACES zif_ale_log_reader. 9 | 10 | PROTECTED SECTION. 11 | PRIVATE SECTION. 12 | ENDCLASS. 13 | 14 | 15 | 16 | CLASS zcl_ale_log_reader_sm21 IMPLEMENTATION. 17 | METHOD zif_ale_log_reader~read. 18 | 19 | DATA syslog_filter TYPE REF TO cl_syslog_filter. 20 | DATA datetime_from TYPE rslgtime. 21 | DATA datetime_to TYPE rslgtime. 22 | DATA syslogs_total TYPE rslgentr_new_tab. 23 | 24 | datetime_from = sy-datum + '000000'. 25 | datetime_to = sy-datum + '235959'. 26 | 27 | syslog_filter = NEW #( ). 28 | 29 | syslog_filter->set_filter_datetime( im_datetime_from = datetime_from 30 | im_datetime_to = datetime_to ). 31 | 32 | DATA(syslog_client) = NEW cl_syslog_sapcontrol_client( ). 33 | 34 | TRY. 35 | DATA(servers) = syslog_client->get_server_names( ). 36 | CATCH cx_server_list. " Exception in creating a server list. 37 | ASSERT 1 = 2. 38 | ENDTRY. 39 | 40 | LOOP AT servers ASSIGNING FIELD-SYMBOL(). 41 | TRY. 42 | DATA(syslogs_server) = syslog_client->read_syslog( iv_hostname = -name ). 43 | syslogs_total = VALUE #( BASE syslogs_total ( LINES OF syslogs_server ) ). 44 | CATCH cx_ai_system_fault. " Application Integration: Technical Error 45 | ASSERT 1 = 2. 46 | ENDTRY. 47 | ENDLOOP. 48 | 49 | LOOP AT syslogs_total ASSIGNING FIELD-SYMBOL(). 50 | 51 | logs = VALUE #( BASE logs ( level = '1' 52 | header_text = -slgtype 53 | item_text = -slgdata ) ). 54 | 55 | ENDLOOP. 56 | 57 | ENDMETHOD. 58 | 59 | ENDCLASS. 60 | -------------------------------------------------------------------------------- /src/zale_reader/zcl_ale_log_reader_sm21.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ALE_LOG_READER_SM21 7 | E 8 | Log Reader SM21 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zale_reader/zcl_ale_log_reader_smicm.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_ale_log_reader_smicm DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | INTERFACES zif_ale_log_reader. 9 | 10 | PROTECTED SECTION. 11 | PRIVATE SECTION. 12 | ENDCLASS. 13 | 14 | 15 | 16 | CLASS zcl_ale_log_reader_smicm IMPLEMENTATION. 17 | METHOD zif_ale_log_reader~read. 18 | sy-subrc = sy-subrc. "placeholder 19 | ENDMETHOD. 20 | 21 | ENDCLASS. 22 | -------------------------------------------------------------------------------- /src/zale_reader/zcl_ale_log_reader_smicm.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_ALE_LOG_READER_SMICM 7 | E 8 | Log Reader SMICM 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/zale_reader/zif_ale_log_reader.intf.abap: -------------------------------------------------------------------------------- 1 | INTERFACE zif_ale_log_reader 2 | PUBLIC . 3 | 4 | CONSTANTS: BEGIN OF con_log_level, 5 | info TYPE c LENGTH 1 VALUE 'I', 6 | warning TYPE c LENGTH 1 VALUE 'W', 7 | error TYPE c LENGTH 1 VALUE 'E', 8 | END OF con_log_level. 9 | 10 | TYPES: BEGIN OF ty_filter_value, 11 | key TYPE string, 12 | value TYPE REF TO data, 13 | END OF ty_filter_value. 14 | 15 | TYPES ty_filter_values TYPE STANDARD TABLE OF ty_filter_value. 16 | 17 | TYPES: BEGIN OF ty_additional_field, 18 | field TYPE string, 19 | value TYPE string, 20 | END OF ty_additional_field. 21 | 22 | TYPES ty_additional_fields TYPE STANDARD TABLE OF ty_additional_field WITH KEY field. 23 | 24 | TYPES: BEGIN OF ty_log, 25 | level TYPE c LENGTH 1, 26 | header_text TYPE string, 27 | item_text TYPE string, 28 | timestamp TYPE timestamp, 29 | additional_fields TYPE ty_additional_fields, 30 | END OF ty_log. 31 | 32 | TYPES ty_logs TYPE STANDARD TABLE OF ty_log WITH DEFAULT KEY. 33 | 34 | METHODS read 35 | IMPORTING filter_values TYPE ty_filter_values 36 | customizing TYPE REF TO zcl_ale_customizing 37 | RETURNING VALUE(logs) TYPE ty_logs. 38 | 39 | ENDINTERFACE. 40 | -------------------------------------------------------------------------------- /src/zale_reader/zif_ale_log_reader.intf.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZIF_ALE_LOG_READER 7 | E 8 | Log Reader 9 | 2 10 | 1 11 | X 12 | 13 | 14 | 15 | 16 | --------------------------------------------------------------------------------