{"action":"created","comment":{"url":"https://api.github.com/repos/inliniac/suricata/pulls/comments/89453977","pull_request_review_id":9998729,"id":89453977,"diff_hunk":"@@ -114,6 +114,9 @@ typedef struct LogFileCtx_ {\n     /* flag to avoid multiple threads printing the same stats */\n     uint8_t flags;\n \n+    /* flag to store the options */\n+    uint8_t options_flags;","path":"src/util-logopenfile.h","position":5,"original_position":5,"commit_id":"d31938bd4294d13f26e5bff88627586b10faa2f4","original_commit_id":"d31938bd4294d13f26e5bff88627586b10faa2f4","user":{"login":"regit","id":308616,"avatar_url":"https://avatars.githubusercontent.com/u/308616?v=3","gravatar_id":"","url":"https://api.github.com/users/regit","html_url":"https://github.com/regit","followers_url":"https://api.github.com/users/regit/followers","following_url":"https://api.github.com/users/regit/following{/other_user}","gists_url":"https://api.github.com/users/regit/gists{/gist_id}","starred_url":"https://api.github.com/users/regit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/regit/subscriptions","organizations_url":"https://api.github.com/users/regit/orgs","repos_url":"https://api.github.com/users/regit/repos","events_url":"https://api.github.com/users/regit/events{/privacy}","received_events_url":"https://api.github.com/users/regit/received_events","type":"User","site_admin":false},"body":"I've just checked the code by removing this and trying to find a structure different from LogFileCtx that could host that. Result is that the LogFileCtx is the first common structure that can be used in all the CreateJSONHeader call contexts.\r\nSo I see the following possibilities:\r\n* We add a union to contain per output type options and variable in LogFileCtx\r\n* We rework all JSON output module to use a intermediate structure that will have a pointer in structure like LogDnsFileCtx\r\n\r\nOn last point, if we look at DNS we have:\r\n```\r\ntypedef struct LogDnsFileCtx_ {\r\n    LogFileCtx *file_ctx;\r\n    uint64_t flags; /** Store mode */\r\n} LogDnsFileCtx;\r\n\r\ntypedef struct LogDnsLogThread_ {\r\n    LogDnsFileCtx *dnslog_ctx;\r\n    /** LogFileCtx has the pointer to the file and a mutex to allow multithreading */\r\n    uint32_t dns_cnt;\r\n\r\n    MemBuffer *buffer;\r\n} LogDnsLogThread;\r\n```\r\nSo we could have a 'wrapper' JSONLogFileCtx in LogDnsFileCtx that contain the LogFileCtx and the JSON options.","created_at":"2016-11-24T08:45:26Z","updated_at":"2016-11-24T08:45:26Z","html_url":"https://github.com/inliniac/suricata/pull/2415#discussion_r89453977","pull_request_url":"https://api.github.com/repos/inliniac/suricata/pulls/2415","_links":{"self":{"href":"https://api.github.com/repos/inliniac/suricata/pulls/comments/89453977"},"html":{"href":"https://github.com/inliniac/suricata/pull/2415#discussion_r89453977"},"pull_request":{"href":"https://api.github.com/repos/inliniac/suricata/pulls/2415"}}},"pull_request":{"url":"https://api.github.com/repos/inliniac/suricata/pulls/2415","id":94998095,"html_url":"https://github.com/inliniac/suricata/pull/2415","diff_url":"https://github.com/inliniac/suricata/pull/2415.diff","patch_url":"https://github.com/inliniac/suricata/pull/2415.patch","issue_url":"https://api.github.com/repos/inliniac/suricata/issues/2415","number":2415,"state":"closed","locked":false,"title":"Ethernet header v2","user":{"login":"regit","id":308616,"avatar_url":"https://avatars.githubusercontent.com/u/308616?v=3","gravatar_id":"","url":"https://api.github.com/users/regit","html_url":"https://github.com/regit","followers_url":"https://api.github.com/users/regit/followers","following_url":"https://api.github.com/users/regit/following{/other_user}","gists_url":"https://api.github.com/users/regit/gists{/gist_id}","starred_url":"https://api.github.com/users/regit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/regit/subscriptions","organizations_url":"https://api.github.com/users/regit/orgs","repos_url":"https://api.github.com/users/regit/repos","events_url":"https://api.github.com/users/regit/events{/privacy}","received_events_url":"https://api.github.com/users/regit/received_events","type":"User","site_admin":false},"body":"A rework of #2411 addressing remarks done on the PR.\r\n\r\nPR builds:\r\n- PR regit: https://buildbot.openinfosecfoundation.org/builders/regit/builds/228\r\n- PR regit-pcap: https://buildbot.openinfosecfoundation.org/builders/regit-pcap/builds/10\r\n","created_at":"2016-11-23T12:57:08Z","updated_at":"2016-11-24T08:45:26Z","closed_at":"2016-11-23T16:07:19Z","merged_at":null,"merge_commit_sha":"37facf9a43ca2e99d2d81eb10362047a145e1360","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/inliniac/suricata/pulls/2415/commits","review_comments_url":"https://api.github.com/repos/inliniac/suricata/pulls/2415/comments","review_comment_url":"https://api.github.com/repos/inliniac/suricata/pulls/comments{/number}","comments_url":"https://api.github.com/repos/inliniac/suricata/issues/2415/comments","statuses_url":"https://api.github.com/repos/inliniac/suricata/statuses/d31938bd4294d13f26e5bff88627586b10faa2f4","head":{"label":"regit:ethernet-header-v2","ref":"ethernet-header-v2","sha":"d31938bd4294d13f26e5bff88627586b10faa2f4","user":{"login":"regit","id":308616,"avatar_url":"https://avatars.githubusercontent.com/u/308616?v=3","gravatar_id":"","url":"https://api.github.com/users/regit","html_url":"https://github.com/regit","followers_url":"https://api.github.com/users/regit/followers","following_url":"https://api.github.com/users/regit/following{/other_user}","gists_url":"https://api.github.com/users/regit/gists{/gist_id}","starred_url":"https://api.github.com/users/regit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/regit/subscriptions","organizations_url":"https://api.github.com/users/regit/orgs","repos_url":"https://api.github.com/users/regit/repos","events_url":"https://api.github.com/users/regit/events{/privacy}","received_events_url":"https://api.github.com/users/regit/received_events","type":"User","site_admin":false},"repo":{"id":5410368,"name":"suricata","full_name":"regit/suricata","owner":{"login":"regit","id":308616,"avatar_url":"https://avatars.githubusercontent.com/u/308616?v=3","gravatar_id":"","url":"https://api.github.com/users/regit","html_url":"https://github.com/regit","followers_url":"https://api.github.com/users/regit/followers","following_url":"https://api.github.com/users/regit/following{/other_user}","gists_url":"https://api.github.com/users/regit/gists{/gist_id}","starred_url":"https://api.github.com/users/regit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/regit/subscriptions","organizations_url":"https://api.github.com/users/regit/orgs","repos_url":"https://api.github.com/users/regit/repos","events_url":"https://api.github.com/users/regit/events{/privacy}","received_events_url":"https://api.github.com/users/regit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/regit/suricata","description":"My personal development tree for Suricata.","fork":true,"url":"https://api.github.com/repos/regit/suricata","forks_url":"https://api.github.com/repos/regit/suricata/forks","keys_url":"https://api.github.com/repos/regit/suricata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/regit/suricata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/regit/suricata/teams","hooks_url":"https://api.github.com/repos/regit/suricata/hooks","issue_events_url":"https://api.github.com/repos/regit/suricata/issues/events{/number}","events_url":"https://api.github.com/repos/regit/suricata/events","assignees_url":"https://api.github.com/repos/regit/suricata/assignees{/user}","branches_url":"https://api.github.com/repos/regit/suricata/branches{/branch}","tags_url":"https://api.github.com/repos/regit/suricata/tags","blobs_url":"https://api.github.com/repos/regit/suricata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/regit/suricata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/regit/suricata/git/refs{/sha}","trees_url":"https://api.github.com/repos/regit/suricata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/regit/suricata/statuses/{sha}","languages_url":"https://api.github.com/repos/regit/suricata/languages","stargazers_url":"https://api.github.com/repos/regit/suricata/stargazers","contributors_url":"https://api.github.com/repos/regit/suricata/contributors","subscribers_url":"https://api.github.com/repos/regit/suricata/subscribers","subscription_url":"https://api.github.com/repos/regit/suricata/subscription","commits_url":"https://api.github.com/repos/regit/suricata/commits{/sha}","git_commits_url":"https://api.github.com/repos/regit/suricata/git/commits{/sha}","comments_url":"https://api.github.com/repos/regit/suricata/comments{/number}","issue_comment_url":"https://api.github.com/repos/regit/suricata/issues/comments{/number}","contents_url":"https://api.github.com/repos/regit/suricata/contents/{+path}","compare_url":"https://api.github.com/repos/regit/suricata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/regit/suricata/merges","archive_url":"https://api.github.com/repos/regit/suricata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/regit/suricata/downloads","issues_url":"https://api.github.com/repos/regit/suricata/issues{/number}","pulls_url":"https://api.github.com/repos/regit/suricata/pulls{/number}","milestones_url":"https://api.github.com/repos/regit/suricata/milestones{/number}","notifications_url":"https://api.github.com/repos/regit/suricata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/regit/suricata/labels{/name}","releases_url":"https://api.github.com/repos/regit/suricata/releases{/id}","deployments_url":"https://api.github.com/repos/regit/suricata/deployments","created_at":"2012-08-14T08:45:02Z","updated_at":"2016-04-11T00:50:36Z","pushed_at":"2016-11-23T09:50:35Z","git_url":"git://github.com/regit/suricata.git","ssh_url":"git@github.com:regit/suricata.git","clone_url":"https://github.com/regit/suricata.git","svn_url":"https://github.com/regit/suricata","homepage":"","size":36397,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":0,"forks":13,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"inliniac:master","ref":"master","sha":"f9f5e8a348e8c042bf0798aa5a1d1797ff2c04be","user":{"login":"inliniac","id":719366,"avatar_url":"https://avatars.githubusercontent.com/u/719366?v=3","gravatar_id":"","url":"https://api.github.com/users/inliniac","html_url":"https://github.com/inliniac","followers_url":"https://api.github.com/users/inliniac/followers","following_url":"https://api.github.com/users/inliniac/following{/other_user}","gists_url":"https://api.github.com/users/inliniac/gists{/gist_id}","starred_url":"https://api.github.com/users/inliniac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inliniac/subscriptions","organizations_url":"https://api.github.com/users/inliniac/orgs","repos_url":"https://api.github.com/users/inliniac/repos","events_url":"https://api.github.com/users/inliniac/events{/privacy}","received_events_url":"https://api.github.com/users/inliniac/received_events","type":"User","site_admin":false},"repo":{"id":5410234,"name":"suricata","full_name":"inliniac/suricata","owner":{"login":"inliniac","id":719366,"avatar_url":"https://avatars.githubusercontent.com/u/719366?v=3","gravatar_id":"","url":"https://api.github.com/users/inliniac","html_url":"https://github.com/inliniac","followers_url":"https://api.github.com/users/inliniac/followers","following_url":"https://api.github.com/users/inliniac/following{/other_user}","gists_url":"https://api.github.com/users/inliniac/gists{/gist_id}","starred_url":"https://api.github.com/users/inliniac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inliniac/subscriptions","organizations_url":"https://api.github.com/users/inliniac/orgs","repos_url":"https://api.github.com/users/inliniac/repos","events_url":"https://api.github.com/users/inliniac/events{/privacy}","received_events_url":"https://api.github.com/users/inliniac/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/inliniac/suricata","description":"Mirror of the official OISF Suricata git repository","fork":false,"url":"https://api.github.com/repos/inliniac/suricata","forks_url":"https://api.github.com/repos/inliniac/suricata/forks","keys_url":"https://api.github.com/repos/inliniac/suricata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inliniac/suricata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inliniac/suricata/teams","hooks_url":"https://api.github.com/repos/inliniac/suricata/hooks","issue_events_url":"https://api.github.com/repos/inliniac/suricata/issues/events{/number}","events_url":"https://api.github.com/repos/inliniac/suricata/events","assignees_url":"https://api.github.com/repos/inliniac/suricata/assignees{/user}","branches_url":"https://api.github.com/repos/inliniac/suricata/branches{/branch}","tags_url":"https://api.github.com/repos/inliniac/suricata/tags","blobs_url":"https://api.github.com/repos/inliniac/suricata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inliniac/suricata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inliniac/suricata/git/refs{/sha}","trees_url":"https://api.github.com/repos/inliniac/suricata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inliniac/suricata/statuses/{sha}","languages_url":"https://api.github.com/repos/inliniac/suricata/languages","stargazers_url":"https://api.github.com/repos/inliniac/suricata/stargazers","contributors_url":"https://api.github.com/repos/inliniac/suricata/contributors","subscribers_url":"https://api.github.com/repos/inliniac/suricata/subscribers","subscription_url":"https://api.github.com/repos/inliniac/suricata/subscription","commits_url":"https://api.github.com/repos/inliniac/suricata/commits{/sha}","git_commits_url":"https://api.github.com/repos/inliniac/suricata/git/commits{/sha}","comments_url":"https://api.github.com/repos/inliniac/suricata/comments{/number}","issue_comment_url":"https://api.github.com/repos/inliniac/suricata/issues/comments{/number}","contents_url":"https://api.github.com/repos/inliniac/suricata/contents/{+path}","compare_url":"https://api.github.com/repos/inliniac/suricata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inliniac/suricata/merges","archive_url":"https://api.github.com/repos/inliniac/suricata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inliniac/suricata/downloads","issues_url":"https://api.github.com/repos/inliniac/suricata/issues{/number}","pulls_url":"https://api.github.com/repos/inliniac/suricata/pulls{/number}","milestones_url":"https://api.github.com/repos/inliniac/suricata/milestones{/number}","notifications_url":"https://api.github.com/repos/inliniac/suricata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inliniac/suricata/labels{/name}","releases_url":"https://api.github.com/repos/inliniac/suricata/releases{/id}","deployments_url":"https://api.github.com/repos/inliniac/suricata/deployments","created_at":"2012-08-14T08:30:06Z","updated_at":"2016-11-23T18:17:17Z","pushed_at":"2016-11-24T02:34:26Z","git_url":"git://github.com/inliniac/suricata.git","ssh_url":"git@github.com:inliniac/suricata.git","clone_url":"https://github.com/inliniac/suricata.git","svn_url":"https://github.com/inliniac/suricata","homepage":"http://suricata-ids.org/","size":53134,"stargazers_count":325,"watchers_count":325,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":294,"mirror_url":null,"open_issues_count":29,"forks":294,"open_issues":29,"watchers":325,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/inliniac/suricata/pulls/2415"},"html":{"href":"https://github.com/inliniac/suricata/pull/2415"},"issue":{"href":"https://api.github.com/repos/inliniac/suricata/issues/2415"},"comments":{"href":"https://api.github.com/repos/inliniac/suricata/issues/2415/comments"},"review_comments":{"href":"https://api.github.com/repos/inliniac/suricata/pulls/2415/comments"},"review_comment":{"href":"https://api.github.com/repos/inliniac/suricata/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/inliniac/suricata/pulls/2415/commits"},"statuses":{"href":"https://api.github.com/repos/inliniac/suricata/statuses/d31938bd4294d13f26e5bff88627586b10faa2f4"}}}}
{"actor":{"display_login":"regit"}}