Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W3C plugin #307

Merged
merged 9 commits into from
Aug 25, 2021
Merged

W3C plugin #307

merged 9 commits into from
Aug 25, 2021

Conversation

jsirianni
Copy link
Member

I can help test this. It depends on a release that does not exists (yet) Stanza v1.1.9. You will need to comment min_stanza_version for now. You can test with a dev branch of stanza, I can help set you up.

The W3C plugin wraps the CSV parser, making use of dynamic field names

  • File input detects W3C headers and attaches them as labls
  • CSV operator will use the Fields label to determine the CSV field names dynamically, for every entry.

This allows the user to read arbitrary W3C files without specifying the field names.

@jsirianni jsirianni requested a review from ericwholt August 20, 2021 18:56
@jsirianni
Copy link
Member Author

You can test this plugin by building this branch observIQ/stanza#404

Copy link
Contributor

@ericwholt ericwholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the following config:

    - type: w3c
      file_log_path: 
      - /Users/ericholt/bindplane/bplogagent-dev/msiis-logs/iis.log
      header_delimiter: " "
      delimiter: " "
      start_at: beginning

IIS Logs Output:

{
  "timestamp": "2021-08-23T21:48:43.197971-04:00",
  "severity": 0,
  "labels": {
    "Date": "2020-11-03 16:13:15",
    "Software": "Microsoft Internet Information Services 10.0",
    "Version": "1.0",
    "file_name": "iis.log",
    "log_type": "w3c",
    "plugin_id": "w3c"
  },
  "record": {
    "c-ip": "10.0.0.2",
    "cs(Referer)": "-",
    "cs(User-Agent)": "Go-http-client/1.1",
    "cs-method": "GET",
    "cs-uri-query": "-",
    "cs-uri-stem": "/status",
    "cs-username": "-",
    "date": "2020-11-03",
    "s-ip": "10.0.0.1",
    "s-port": "80",
    "sc-status": "404",
    "sc-substatus": "0",
    "sc-win32-status": "2",
    "time": "16:13:15",
    "time-taken": "1"
  }
}

plugins/w3c.yaml Outdated Show resolved Hide resolved
plugins/w3c.yaml Outdated Show resolved Hide resolved
Joseph Sirianni and others added 3 commits August 24, 2021 09:22
Co-authored-by: EricWHolt <39141134+ericwholt@users.noreply.github.com>
@jsirianni jsirianni merged commit dac1c33 into master Aug 25, 2021
@jsirianni jsirianni deleted the w3c branch August 25, 2021 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants