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

enhancement(external docs): Update S3 source example #9838

Merged
merged 2 commits into from Nov 1, 2021

Conversation

maxknee
Copy link
Contributor

@maxknee maxknee commented Oct 29, 2021

This PR updates the example to make the regex a one-liner so users can copy-paste and doesn't cause their configs to error.

@netlify
Copy link

netlify bot commented Oct 29, 2021

✔️ Deploy Preview for vector-project ready!

🔨 Explore the source changes: 8ed6e8c

🔍 Inspect the deploy log: https://app.netlify.com/sites/vector-project/deploys/617c694a7e737b0007fba7f4

😎 Browse the preview: https://deploy-preview-9838--vector-project.netlify.app

Signed-off-by: Max Knee <Max_Knee@comcast.com>
@bruceg bruceg assigned bruceg and lucperkins and unassigned bruceg Oct 29, 2021
@bruceg bruceg added domain: external docs Anything related to Vector's external, public documentation source: aws_s3 Anything `aws_s3` source related labels Oct 29, 2021
@lucperkins
Copy link
Contributor

lucperkins commented Oct 29, 2021

@maxknee You are quite right that this config won't work if copy-pasted! The issue, as you've rightly pointed out, is that this doesn't work as a multi-line string. I think the solution that we would prefer, however, is to keep this as a multi-line string for the sake of readability but fix the TOML syntax. This should do the trick:

regex = '''
  (?x)^
  (?P<type>[\\w]+)[ ]
  (?P<timestamp>[\\w:.-]+)[ ]
  (?P<elb>[^\\s]+)[ ]
  (?P<client_host>[\\d.:-]+)[ ]
  (?P<target_host>[\\d.:-]+)[ ]
  (?P<request_processing_time>[\\d.-]+)[ ]
  (?P<target_processing_time>[\\d.-]+)[ ]
  (?P<response_processing_time>[\\d.-]+)[ ]
  (?P<elb_status_code>[\\d-]+)[ ]
  (?P<target_status_code>[\\d-]+)[ ]
  (?P<received_bytes>[\\d-]+)[ ]
  (?P<sent_bytes>[\\d-]+)[ ]
  "(?P<request_method>[\\w-]+)[ ]
  (?P<request_url>[^\\s]+)[ ]
  (?P<request_protocol>[^"\\s]+)"[ ]
  "(?P<user_agent>[^"]+)"[ ]
  (?P<ssl_cipher>[^\\s]+)[ ]
  (?P<ssl_protocol>[^\\s]+)[ ]
  (?P<target_group_arn>[\\w.:/-]+)[ ]
  "(?P<trace_id>[^\\s"]+)"[ ]
  "(?P<domain_name>[^\\s"]+)"[ ]
  "(?P<chosen_cert_arn>[\\w:./-]+)"[ ]
  (?P<matched_rule_priority>[\\d-]+)[ ]
  (?P<request_creation_time>[\\w.:-]+)[ ]
  "(?P<actions_executed>[\\w,-]+)"[ ]
  "(?P<redirect_url>[^"]+)"[ ]
  "(?P<error_reason>[^"]+)"
'''

Would you be willing to perhaps verify that this works locally and update your PR?

Signed-off-by: Max Knee <Max_Knee@comcast.com>
@maxknee
Copy link
Contributor Author

maxknee commented Oct 29, 2021

Yep! one sec!

@maxknee
Copy link
Contributor Author

maxknee commented Oct 29, 2021

it works!

Copy link
Member

@jszwedko jszwedko left a comment

Choose a reason for hiding this comment

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

Thanks @maxknee !

@jszwedko jszwedko enabled auto-merge (squash) November 1, 2021 15:13
@jszwedko jszwedko merged commit a720c63 into vectordotdev:master Nov 1, 2021
lucperkins pushed a commit that referenced this pull request Nov 2, 2021
* updating regex for usage

Signed-off-by: Max Knee <Max_Knee@comcast.com>

* using multi-line toml syntax

Signed-off-by: Max Knee <Max_Knee@comcast.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: external docs Anything related to Vector's external, public documentation source: aws_s3 Anything `aws_s3` source related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants