{ "info": { "author": "Namit Chaturvedi", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: Log Analysis", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "[![Build Status](https://www.travis-ci.org/chaturv3di/absynthe.svg?branch=master)](https://www.travis-ci.org/chaturv3di/absynthe)\n\n# Absynthe: A (branching) Behavior Synthesizer\n\n## Motivation\n\nAbsynthe came about in response to the need for test data for analysizing the\nperformance and accuracy of log analysis algorithms. Even though plenty of real\nlife logs are available, e.g. `/var/log/` in unix-based laptops, they do not\nserve the purpose of test data. For that, we need to understand the core\napplication logic that is generating these logs.\n\nA more interesting situation arises while trying to test log analytic (and\nanomaly detection) solutions for distributed applications where multiple\nsources or modules emit their respective log messages in a single log queue or\nstream. This means that consecutive log lines could have originated from\ndifferent, unrelated application components. Absynthe provides _ground truth_\nmodels to simulate such situations.\n\nYou need Absynthe if you wish to simulate the behavior of any well defined \nprocess -- whether it's a computer application or a business process flow.\n\n## Overview\n\nEach business process or compuater application is modelled as a _control flow\ngraph_ (or _CFG_), which typically has one or more roots (i.e. entry) nodes and\nmultiple leaf (i.e. end) nodes.\n\n### Tree-like CFG\n\nAn example of a simple, tree-like CFG generated using Absynthe is shown below.\nThis is like a tree since nodes are laid out in levels, and nodes at level `i`\nhave outgoing edges only to nodes at level `i + 1`.\n\n\n\nEach _behavior_ is the sequence of nodes encountered while traversing this CFG \nfrom a root to a leaf. Of course, a CFG might contain loops which could be\ntraversed multiple times before arriving at the leaf. Moreover, if there are\nmultiple CFGs, then Absynthe can synthesize _interleaved_ behaviors. This means\nthat a single sequence of nodes might contain nodes from multiple CFGs. We are \nultimately interested in this interleaving behavior, which is produced by\nmultiple CFGs.\n\n\n\nThe above screenshot shows logs generated by Absynthe. Each log line starts\nwith a time stamp, followed by a session ID, CFG ID, and a log message. At\npresent, the log message is simply a random concatenation of the node ID to\nwhich the log message corresponds. A single CFG might participate in multiple\nsessions, where each session is a different traversal of the CFG. Therefore, we\nmaintain both session ID and CFG ID in the log line.\n\n### Directed Cyclic CFG\n\nAn example of a more complex CFG, a directed cyclic graph, is shown in the\nfigure below. It expands the tree-like graph illustrated above by:\n\n1. attaching loops on some of the nodes,\n2. constructing skip-level edges, i.e. edges from a node at level `i` to a\nnode at level ≥`(i + 2)`, and\n3. optionally, upward edges (not shown here), i.e. edges from a node at\nlevel `i` to a node at level ≤`(i - 1)`.\n\n\n\nThe identifiers of nodes appearing loops are helpfully prefixed with the\nidentifiers of nodes where these loops start and finish. Moreover, loops could\nbe traversed multiple times in a single behavior, as illustrated in the figure\nbelow.\n\n\n\n## Installation\n\nThis package has been developed with `Python 3.6.*` and depends on `scipy 1.2.1`.\nThings might not work with `Python 3.7.*` or `scipy 1.3.*`. Therefore, consider\ncreating a virtual environment if your default configuration differs.\n\nThe latest release is available on PyPi, simply `pip install absynthe`. The\n`master` branch of this repository will always provide the latest release.\n\nFor the latest features not yet released, clone or download the `develop` branch\nand then:\n\n```bash\n# Change dir to absynthe\ncd /path/to/absynthe\n\n# Install dependencies\npip install -r requirements.txt\n\n# Install absynthe\npip install .\n```\n\n## Usage\n\nIt is possible to start using Absynthe with two classes:\n\n1. any concrete implementation of the abstract `GraphBuilder` class, which\ngenerates CFGs, and\n2. any concrete implementation of the abstract `Behavior` class, which\ntraverses the CFGs generated above and emits log messages.\n\nFor instance, consider the `basicLogGeneration` method in\n`./examples/01_generateSimpleBehavior.py`:\n\n```python3\nfrom absynthe.graph_builder import TreeBuilder\nfrom absynthe.behavior import MonospaceInterleaving\n\n\ndef basicLogGeneration(numRoots: int = 2, numLeaves: int = 4,\n branching: int = 2, numInnerNodes: int = 16,\n loggerNodeTypes: str = \"SimpleLoggerNode\"):\n # Capture all the arguments required by GraphBuilder class\n tree_kwargs = {TreeBuilder.KW_NUM_ROOTS: str(numRoots),\n TreeBuilder.KW_NUM_LEAVES: str(numLeaves),\n TreeBuilder.KW_BRANCHING_DEGREE: str(branching),\n TreeBuilder.KW_NUM_INNER_NODES: str(numInnerNodes),\n TreeBuilder.KW_SUPPORTED_NODE_TYPES: loggerNodeTypes}\n\n # Instantiate a concrete GraphBuilder. Note that the\n # generateNewGraph() method of this class returns a\n # new, randomly generated graph that (more or less)\n # satisfies all the parameters provided to the\n # constructor, viz. tree_kwargs in the present case.\n simpleTreeBuilder = TreeBuilder(**tree_kwargs)\n\n # Instantiate a concrete behavior generator. Some\n # behavior generators do not print unique session ID\n # for each run, but it's nice to have those.\n wSessionID: bool = True\n exBehavior = MonospaceInterleaving(wSessionID)\n\n # Add multiple graphs to this behavior generator. The\n # behaviors that it will synthesize would essentially\n # be interleavings of simultaneous traversals of all\n # these graphs.\n exBehavior.addGraph(simpleTreeBuilder.generateNewGraph())\n exBehavior.addGraph(simpleTreeBuilder.generateNewGraph())\n exBehavior.addGraph(simpleTreeBuilder.generateNewGraph())\n exBehavior.addGraph(simpleTreeBuilder.generateNewGraph())\n\n # Specify how many behaviors are to be synthesized,\n # and get going.\n numTraversalsOfEachGraph: int = 2\n for logLine in exBehavior.synthesize(numTraversalsOfEachGraph):\n print(logLine)\n return\n```\n\nIn order to generate behaviors from a directed cyclic CFG, create a DCG as shown\nin `./examples/03_generateControlFlowDCG.py` and then generate behaviors after\nadding the DCG to a behavior object as shown in the code snippet above.\n\n**Note:** When generating a behavior, i.e. when traversing a graph, successors\nof nodes are chosen based on the probability distributions associated with those\nnodes. Different nodes rely on different distributions and these nodes are\nrandomly assigned in the graphs that are constructed by `generateNewGraph()`\nmethods, resulting in graphs with a mix of nodes.\n\n## Release Notes\n\n**Note:** This tool is still in alpha stage, so backward compatibility is not\nguaranteed between releases. However, inasmuch as users stick to graph builders'\n`generateNewGraph()` methods, they will stay away from compatibility problems.\n\n### Major changes in v0.0.2\n\n1. Added new graph builders, viz. `DAGBuilder` and `DCGBuilder`, which build\nCFGs with skip-level edges and loops respectively.\n2. Added new node, viz. `BinomialNode`, which exploits the binomial distribution\nin order to select its successors at the time of graph traversal.\n3. Added a separate utility class called `Utils` in `absynthe.cfg.utils.py` to\ncreate a new `Node` object from any of the concrete implementations of `Node` at\nrandom. All concrete implementations of `Node` therefore transparently available\nto graph builders (and everyone else) through this utility.\n\n### Coming up in future releases\n\n1. Sophisticated interleaving behaviors\n2. Logger nodes that emit more _life like_ log messages\n3. *Anomalous* behaviors\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/chaturv3di/absynthe/", "keywords": "", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "absynthe", "package_url": "https://pypi.org/project/absynthe/", "platform": "", "project_url": "https://pypi.org/project/absynthe/", "project_urls": { "Homepage": "https://github.com/chaturv3di/absynthe/" }, "release_url": "https://pypi.org/project/absynthe/0.0.3/", "requires_dist": [ "scipy (==1.2.1)", "numpy (==1.16.4)" ], "requires_python": ">=3.6.0", "summary": "A (branching) Behaviour Synthesizer", "version": "0.0.3" }, "last_serial": 5441579, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "1e70710b987a97422d8ba5f515b5d46a", "sha256": "585ab262c808d2be1889fa6596eb5682aa2fbd193b3ec512bcfd5a7731ec94de" }, "downloads": -1, "filename": "absynthe-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1e70710b987a97422d8ba5f515b5d46a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 22094, "upload_time": "2019-06-05T19:26:32", "url": "https://files.pythonhosted.org/packages/1c/da/00d7d1268a91ad1bfc8c7f25c5bdda872595e202dc0dac09c5a9d9cea376/absynthe-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a350e70ad8cf84ef73ebf0fec5df6c6c", "sha256": "0d2742be2ea9f2ecd12a09e920f1c8702ad3a427aebf37c95f3b24bf96c72c08" }, "downloads": -1, "filename": "absynthe-0.0.1.tar.gz", "has_sig": false, "md5_digest": "a350e70ad8cf84ef73ebf0fec5df6c6c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 12904, "upload_time": "2019-06-05T19:26:35", "url": "https://files.pythonhosted.org/packages/d2/49/a09e202c31f9880e0d1891db436da543c3981e0db177ce5b9a16a3036bba/absynthe-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "b14c6128a7dcb6512acba16c07207f01", "sha256": "239d6537910d82a4c1f1f7fbe8b8b3311c12fba82f613d29094566ac28da3519" }, "downloads": -1, "filename": "absynthe-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "b14c6128a7dcb6512acba16c07207f01", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 28250, "upload_time": "2019-06-24T16:28:26", "url": "https://files.pythonhosted.org/packages/30/75/4e263b4f872a1fa62841bc9494660abd925d76f6b402f8592cf95385bd05/absynthe-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9c0873e4d9683d3c1063a98dbd022445", "sha256": "d3123b1629da584a56e6950f5f9d7d2627902aa8b1c4cd30a6e71f9ac5d403d9" }, "downloads": -1, "filename": "absynthe-0.0.2.tar.gz", "has_sig": false, "md5_digest": "9c0873e4d9683d3c1063a98dbd022445", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 18891, "upload_time": "2019-06-24T16:28:28", "url": "https://files.pythonhosted.org/packages/c4/ae/439b2cca85502ab134b4c12a144e9a0b6cb5a5bd81eeb2d17e28fea2506f/absynthe-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "e9fcf76c2a2d5e51894c982ab5a31816", "sha256": "167b799409a85e67bb84de6d852804ac5653e03fb51e10d488a21c8e1dc595c3" }, "downloads": -1, "filename": "absynthe-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "e9fcf76c2a2d5e51894c982ab5a31816", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 28279, "upload_time": "2019-06-24T16:47:01", "url": "https://files.pythonhosted.org/packages/e2/f1/6a38089203b4bb16780a69760d50e35ddcf1672dad459030b52ca8d644b9/absynthe-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ebec2edae49863f98f31e2652164eb54", "sha256": "6671897e0f7e8995f37cab2f874423b06989633c1a87e9d0227887b7dcbd3cd9" }, "downloads": -1, "filename": "absynthe-0.0.3.tar.gz", "has_sig": false, "md5_digest": "ebec2edae49863f98f31e2652164eb54", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 18969, "upload_time": "2019-06-24T16:47:02", "url": "https://files.pythonhosted.org/packages/52/7f/809b44904693d9b6d0fc199d8b4140ddcc679f138674c30f31d707131e68/absynthe-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e9fcf76c2a2d5e51894c982ab5a31816", "sha256": "167b799409a85e67bb84de6d852804ac5653e03fb51e10d488a21c8e1dc595c3" }, "downloads": -1, "filename": "absynthe-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "e9fcf76c2a2d5e51894c982ab5a31816", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 28279, "upload_time": "2019-06-24T16:47:01", "url": "https://files.pythonhosted.org/packages/e2/f1/6a38089203b4bb16780a69760d50e35ddcf1672dad459030b52ca8d644b9/absynthe-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ebec2edae49863f98f31e2652164eb54", "sha256": "6671897e0f7e8995f37cab2f874423b06989633c1a87e9d0227887b7dcbd3cd9" }, "downloads": -1, "filename": "absynthe-0.0.3.tar.gz", "has_sig": false, "md5_digest": "ebec2edae49863f98f31e2652164eb54", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 18969, "upload_time": "2019-06-24T16:47:02", "url": "https://files.pythonhosted.org/packages/52/7f/809b44904693d9b6d0fc199d8b4140ddcc679f138674c30f31d707131e68/absynthe-0.0.3.tar.gz" } ] }