diff --git a/README.md b/README.md index 6c910f2..75442af 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ workspaces/custom_parser/ # workspace root │ └── custom_parser.py # CoreParser-based template ├── tests/ │ └── test_custom_parser.py # generated from template to test custom_parser +├── data.json # example data to run the code ├── LICENSE.md # copied from main project ├── .gitignore # copied from main project ├── .pre-commit-config.yaml # copied from main project diff --git a/docs/basic_usage.md b/docs/basic_usage.md index 4207789..b24141f 100644 --- a/docs/basic_usage.md +++ b/docs/basic_usage.md @@ -1,9 +1,155 @@ # Getting started: Basic usage -Basic usage of the DetectMate Library. +In this section, we will show different examples of the basic usage of the DetectMate Library. +## Parser +In this example, we will use the [`MatcherParser`](parsers/template_matcher.md) to parse audit data from the [AIT Log Data Set V2.0](https://zenodo.org/records/5789064). The code loads the logs, parse them and save the input and output in json files using [`from_to`](helper/from_to.md) module. + +```python +from detectmatelibrary.parsers.template_matcher import MatcherParser +from detectmatelibrary.helper.from_to import From, To + + +config_dict = { + "parsers": { + "MatcherParser": { + "auto_config": True, + "method_type": "matcher_parser", + "path_templates": "ait_audit.txt", + "log_format": r'type= msg=audit\(