payload: {"action":"created","comment":{"url":"https://api.github.com/repos/apache/metron/pulls/comments/285254581","pull_request_review_id":239090182,"id":285254581,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4NTI1NDU4MQ==","diff_hunk":"@@ -0,0 +1,236 @@\n+/**\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.apache.metron.parsers.leef;\n+\n+import java.lang.invoke.MethodHandles;\n+import java.nio.charset.Charset;\n+import java.text.SimpleDateFormat;\n+import java.time.Clock;\n+import java.util.ArrayList;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.regex.Matcher;\n+import java.util.regex.Pattern;\n+\n+import org.apache.metron.parsers.BasicParser;\n+import org.apache.metron.parsers.ParseException;\n+import org.apache.metron.parsers.cef.CEFParser;\n+import org.apache.metron.parsers.utils.DateUtils;\n+import org.apache.metron.parsers.utils.SyslogUtils;\n+import org.json.simple.JSONObject;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+public class LEEFParser extends BasicParser {\n+\tprivate static final long serialVersionUID = 1L;\n+\n+\tprotected static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());\n+\tprivate static final String HEADER_CAPTURE_PATTERN = \"[^\\\\|]*\";\n+\tprivate static final Charset UTF_8 = Charset.forName(\"UTF-8\");\n+\tprivate static final String EXTENSION_CAPTURE_PATTERN = \"(?<!\\\\\\\\)=\";\n+\n+\tprivate Pattern p;\n+\tprivate Pattern pext;\n+\n+\tpublic void init() {\n+\n+\t\t// CEF Headers: Device Vendor|Device Product|Device Version|Device Event\n+\t\t// Class ID|Name|Severity\n+","path":"metron-platform/metron-parsing/metron-parsers/src/main/java/org/apache/metron/parsers/leef/LEEFParser.java","position":54,"original_position":54,"commit_id":"86f6bd188169f76316621c5ad033c893bc87e5a2","original_commit_id":"86f6bd188169f76316621c5ad033c893bc87e5a2","user":{"login":"ottobackwards","id":1111551,"node_id":"MDQ6VXNlcjExMTE1NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1111551?v=4","gravatar_id":"","url":"https://api.github.com/users/ottobackwards","html_url":"https://github.com/ottobackwards","followers_url":"https://api.github.com/users/ottobackwards/followers","following_url":"https://api.github.com/users/ottobackwards/following{/other_user}","gists_url":"https://api.github.com/users/ottobackwards/gists{/gist_id}","starred_url":"https://api.github.com/users/ottobackwards/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ottobackwards/subscriptions","organizations_url":"https://api.github.com/users/ottobackwards/orgs","repos_url":"https://api.github.com/users/ottobackwards/repos","events_url":"https://api.github.com/users/ottobackwards/events{/privacy}","received_events_url":"https://api.github.com/users/ottobackwards/received_events","type":"User","site_admin":false},"body":"these constant strings can be.... content strings ( static final etc )","created_at":"2019-05-17T19:10:05Z","updated_at":"2019-05-17T19:18:38Z","html_url":"https://github.com/apache/metron/pull/1408#discussion_r285254581","pull_request_url":"https://api.github.com/repos/apache/metron/pulls/1408","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/metron/pulls/comments/285254581"},"html":{"href":"https://github.com/apache/metron/pull/1408#discussion_r285254581"},"pull_request":{"href":"https://api.github.com/repos/apache/metron/pulls/1408"}}},"pull_request":{"url":"https://api.github.com/repos/apache/metron/pulls/1408","id":279978866,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjc5OTc4ODY2","html_url":"https://github.com/apache/metron/pull/1408","diff_url":"https://github.com/apache/metron/pull/1408.diff","patch_url":"https://github.com/apache/metron/pull/1408.patch","issue_url":"https://api.github.com/repos/apache/metron/issues/1408","number":1408,"state":"open","locked":false,"title":"METRON-2118: Added a LEEF parser","user":{"login":"simonellistonball","id":1217895,"node_id":"MDQ6VXNlcjEyMTc4OTU=","avatar_url":"https://avatars3.githubusercontent.com/u/1217895?v=4","gravatar_id":"","url":"https://api.github.com/users/simonellistonball","html_url":"https://github.com/simonellistonball","followers_url":"https://api.github.com/users/simonellistonball/followers","following_url":"https://api.github.com/users/simonellistonball/following{/other_user}","gists_url":"https://api.github.com/users/simonellistonball/gists{/gist_id}","starred_url":"https://api.github.com/users/simonellistonball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonellistonball/subscriptions","organizations_url":"https://api.github.com/users/simonellistonball/orgs","repos_url":"https://api.github.com/users/simonellistonball/repos","events_url":"https://api.github.com/users/simonellistonball/events{/privacy}","received_events_url":"https://api.github.com/users/simonellistonball/received_events","type":"User","site_admin":false},"body":"## Contributor Comments\r\nLEEF is a popular format in IBM shops as it is the default supported by Qradar. In a number of ways it is similar to CEF. This PR supports LEEF 1.0 and 2.0 per the IBM guide at https://www.ibm.com/support/knowledgecenter/SS42VS_DSM/c_LEEF_Format_Guide_intro.html and also some found in the wild examples which are technically not up to the IBM spec, and are much closer to the CEF spec.\r\n\r\nThe CEF parser has been slightly refactored in this effort to expose CEF extension parsing for reuse in the LEEF parser for in the wild examples of CEF style 'delimiters'.\r\n\r\nThis has been tested against a variety of samples from public sources, and from synthetic data generated according to the spec in new unit tests.\r\n\r\n## Pull Request Checklist\r\n\r\nThank you for submitting a contribution to Apache Metron.  \r\nPlease refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions.  \r\nPlease refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) for complete smoke testing guides.  \r\n\r\n\r\nIn order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following:\r\n\r\n### For all changes:\r\n- [X] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel).\r\n- [X] Does your PR title start with METRON-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen \"-\" character.\r\n- [X] Has your PR been rebased against the latest commit within the target branch (typically master)?\r\n\r\n\r\n### For code changes:\r\n- [X] Have you included steps to reproduce the behavior or problem that is being changed or addressed?\r\n- [X] Have you included steps or a guide to how the change may be verified and tested manually?\r\n- [X] Have you ensured that the full suite of tests and checks have been executed in the root metron folder via:\r\n  ```\r\n  mvn -q clean integration-test install && dev-utilities/build-utils/verify_licenses.sh \r\n  ```\r\n\r\n- [X] Have you written or updated unit tests and or integration tests to verify your changes?\r\n- [X] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?\r\n- [ ] Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?\r\n\r\n### For documentation related changes:\r\n- [ ] Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via `site-book/target/site/index.html`:\r\n\r\n  ```\r\n  cd site-book\r\n  mvn site\r\n  ```\r\n\r\n- [ ] Have you ensured that any documentation diagrams have been updated, along with their source files, using [draw.io](https://www.draw.io/)? See [Metron Development Guidelines](https://cwiki.apache.org/confluence/display/METRON/Development+Guidelines) for instructions.\r\n\r\n#### Note:\r\nPlease ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.\r\nIt is also recommended that [travis-ci](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request.\r\n","created_at":"2019-05-17T17:48:52Z","updated_at":"2019-05-17T19:18:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd304bbaba9247721a3412e060b541c674df0df9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/metron/pulls/1408/commits","review_comments_url":"https://api.github.com/repos/apache/metron/pulls/1408/comments","review_comment_url":"https://api.github.com/repos/apache/metron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/metron/issues/1408/comments","statuses_url":"https://api.github.com/repos/apache/metron/statuses/86f6bd188169f76316621c5ad033c893bc87e5a2","head":{"label":"simonellistonball:leef-parser","ref":"leef-parser","sha":"86f6bd188169f76316621c5ad033c893bc87e5a2","user":{"login":"simonellistonball","id":1217895,"node_id":"MDQ6VXNlcjEyMTc4OTU=","avatar_url":"https://avatars3.githubusercontent.com/u/1217895?v=4","gravatar_id":"","url":"https://api.github.com/users/simonellistonball","html_url":"https://github.com/simonellistonball","followers_url":"https://api.github.com/users/simonellistonball/followers","following_url":"https://api.github.com/users/simonellistonball/following{/other_user}","gists_url":"https://api.github.com/users/simonellistonball/gists{/gist_id}","starred_url":"https://api.github.com/users/simonellistonball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonellistonball/subscriptions","organizations_url":"https://api.github.com/users/simonellistonball/orgs","repos_url":"https://api.github.com/users/simonellistonball/repos","events_url":"https://api.github.com/users/simonellistonball/events{/privacy}","received_events_url":"https://api.github.com/users/simonellistonball/received_events","type":"User","site_admin":false},"repo":{"id":62879739,"node_id":"MDEwOlJlcG9zaXRvcnk2Mjg3OTczOQ==","name":"metron","full_name":"simonellistonball/metron","private":false,"owner":{"login":"simonellistonball","id":1217895,"node_id":"MDQ6VXNlcjEyMTc4OTU=","avatar_url":"https://avatars3.githubusercontent.com/u/1217895?v=4","gravatar_id":"","url":"https://api.github.com/users/simonellistonball","html_url":"https://github.com/simonellistonball","followers_url":"https://api.github.com/users/simonellistonball/followers","following_url":"https://api.github.com/users/simonellistonball/following{/other_user}","gists_url":"https://api.github.com/users/simonellistonball/gists{/gist_id}","starred_url":"https://api.github.com/users/simonellistonball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonellistonball/subscriptions","organizations_url":"https://api.github.com/users/simonellistonball/orgs","repos_url":"https://api.github.com/users/simonellistonball/repos","events_url":"https://api.github.com/users/simonellistonball/events{/privacy}","received_events_url":"https://api.github.com/users/simonellistonball/received_events","type":"User","site_admin":false},"html_url":"https://github.com/simonellistonball/metron","description":"Mirror of Apache Metron (Incubating)","fork":true,"url":"https://api.github.com/repos/simonellistonball/metron","forks_url":"https://api.github.com/repos/simonellistonball/metron/forks","keys_url":"https://api.github.com/repos/simonellistonball/metron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simonellistonball/metron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simonellistonball/metron/teams","hooks_url":"https://api.github.com/repos/simonellistonball/metron/hooks","issue_events_url":"https://api.github.com/repos/simonellistonball/metron/issues/events{/number}","events_url":"https://api.github.com/repos/simonellistonball/metron/events","assignees_url":"https://api.github.com/repos/simonellistonball/metron/assignees{/user}","branches_url":"https://api.github.com/repos/simonellistonball/metron/branches{/branch}","tags_url":"https://api.github.com/repos/simonellistonball/metron/tags","blobs_url":"https://api.github.com/repos/simonellistonball/metron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simonellistonball/metron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simonellistonball/metron/git/refs{/sha}","trees_url":"https://api.github.com/repos/simonellistonball/metron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simonellistonball/metron/statuses/{sha}","languages_url":"https://api.github.com/repos/simonellistonball/metron/languages","stargazers_url":"https://api.github.com/repos/simonellistonball/metron/stargazers","contributors_url":"https://api.github.com/repos/simonellistonball/metron/contributors","subscribers_url":"https://api.github.com/repos/simonellistonball/metron/subscribers","subscription_url":"https://api.github.com/repos/simonellistonball/metron/subscription","commits_url":"https://api.github.com/repos/simonellistonball/metron/commits{/sha}","git_commits_url":"https://api.github.com/repos/simonellistonball/metron/git/commits{/sha}","comments_url":"https://api.github.com/repos/simonellistonball/metron/comments{/number}","issue_comment_url":"https://api.github.com/repos/simonellistonball/metron/issues/comments{/number}","contents_url":"https://api.github.com/repos/simonellistonball/metron/contents/{+path}","compare_url":"https://api.github.com/repos/simonellistonball/metron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simonellistonball/metron/merges","archive_url":"https://api.github.com/repos/simonellistonball/metron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simonellistonball/metron/downloads","issues_url":"https://api.github.com/repos/simonellistonball/metron/issues{/number}","pulls_url":"https://api.github.com/repos/simonellistonball/metron/pulls{/number}","milestones_url":"https://api.github.com/repos/simonellistonball/metron/milestones{/number}","notifications_url":"https://api.github.com/repos/simonellistonball/metron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simonellistonball/metron/labels{/name}","releases_url":"https://api.github.com/repos/simonellistonball/metron/releases{/id}","deployments_url":"https://api.github.com/repos/simonellistonball/metron/deployments","created_at":"2016-07-08T10:09:06Z","updated_at":"2019-04-05T12:32:37Z","pushed_at":"2019-05-17T14:57:14Z","git_url":"git://github.com/simonellistonball/metron.git","ssh_url":"git@github.com:simonellistonball/metron.git","clone_url":"https://github.com/simonellistonball/metron.git","svn_url":"https://github.com/simonellistonball/metron","homepage":null,"size":94826,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"506c18cb5abe3a8ec1d660af9350382e085c6e15","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":47607561,"node_id":"MDEwOlJlcG9zaXRvcnk0NzYwNzU2MQ==","name":"metron","full_name":"apache/metron","private":false,"owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/apache/metron","description":"Apache Metron","fork":false,"url":"https://api.github.com/repos/apache/metron","forks_url":"https://api.github.com/repos/apache/metron/forks","keys_url":"https://api.github.com/repos/apache/metron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/metron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/metron/teams","hooks_url":"https://api.github.com/repos/apache/metron/hooks","issue_events_url":"https://api.github.com/repos/apache/metron/issues/events{/number}","events_url":"https://api.github.com/repos/apache/metron/events","assignees_url":"https://api.github.com/repos/apache/metron/assignees{/user}","branches_url":"https://api.github.com/repos/apache/metron/branches{/branch}","tags_url":"https://api.github.com/repos/apache/metron/tags","blobs_url":"https://api.github.com/repos/apache/metron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/metron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/metron/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/metron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/metron/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/metron/languages","stargazers_url":"https://api.github.com/repos/apache/metron/stargazers","contributors_url":"https://api.github.com/repos/apache/metron/contributors","subscribers_url":"https://api.github.com/repos/apache/metron/subscribers","subscription_url":"https://api.github.com/repos/apache/metron/subscription","commits_url":"https://api.github.com/repos/apache/metron/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/metron/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/metron/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/metron/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/metron/contents/{+path}","compare_url":"https://api.github.com/repos/apache/metron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/metron/merges","archive_url":"https://api.github.com/repos/apache/metron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/metron/downloads","issues_url":"https://api.github.com/repos/apache/metron/issues{/number}","pulls_url":"https://api.github.com/repos/apache/metron/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/metron/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/metron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/metron/labels{/name}","releases_url":"https://api.github.com/repos/apache/metron/releases{/id}","deployments_url":"https://api.github.com/repos/apache/metron/deployments","created_at":"2015-12-08T08:00:05Z","updated_at":"2019-05-17T07:56:03Z","pushed_at":"2019-05-17T18:17:22Z","git_url":"git://github.com/apache/metron.git","ssh_url":"git@github.com:apache/metron.git","clone_url":"https://github.com/apache/metron.git","svn_url":"https://github.com/apache/metron","homepage":"","size":94696,"stargazers_count":626,"watchers_count":626,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":436,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":26,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":436,"open_issues":26,"watchers":626,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/metron/pulls/1408"},"html":{"href":"https://github.com/apache/metron/pull/1408"},"issue":{"href":"https://api.github.com/repos/apache/metron/issues/1408"},"comments":{"href":"https://api.github.com/repos/apache/metron/issues/1408/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/metron/pulls/1408/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/metron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/metron/pulls/1408/commits"},"statuses":{"href":"https://api.github.com/repos/apache/metron/statuses/86f6bd188169f76316621c5ad033c893bc87e5a2"}},"author_association":"CONTRIBUTOR"}}
other: {"actor":{"display_login":"ottobackwards"}}