-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Beatless initial PR #8485
Merged
+4,884
−192
Merged
Beatless initial PR #8485
Changes from all commits
Commits
Show all changes
102 commits
Select commit
Hold shift + click to select a range
9a4b449
Initial version of beatless
ph 03efcf3
update function
ph e3cbcd5
Will be in another PR.
ph 04761ea
remove trace
ph 73105ea
Correctly report double licensed project and allow to skip file
ph cb4cfbf
oops
ph 38a23ed
wrong config in the yaml
ph 2468b2e
first round of comments from kvch
ph e78044f
pep8
ph f7be0bc
cleanup and fix a issue with the rebase.
ph 4343913
missing file
ph 558941a
Initial version of beatless
ph 2f639bd
bad type
ph be469c7
Correctly report double licensed project and allow to skip file
ph aff6606
oops
ph 9441f00
More refactoring a lot cleaner
ph d6e3d93
Adding logs and removal of subscription
ph fe92882
typo
ph ab02ae6
working on update
ph 9e7a875
reorder methods and create an alias on the function
ph 43f89ab
update alias
ph 8098a38
cleaning the code.
ph 897affa
Missing headers
ph f1c705f
Adding tests and renamed executer to executor
ph 31c736e
fix failure
ph 243c184
renaming adding tests
ph af5dc0d
what?
ph 9b32a2b
Adding sanity check for cloudwatch logs
ph b5b0285
align problems
ph d430e82
sanity check for kinesis
ph acb0726
Adding SQS test
ph 3b46144
adding headers
ph f5216f8
adding test for api gateway proxy
ph 6b9d789
Trying out serverless framework with beatless
ph ee3e628
ok work as dependencies
ph cc6dc0a
Cloud formation
ph 7ed21c5
Not needed
ph 63c2947
make it work with waiting
ph e2e7bbe
update cloudformation
ph 14ccd23
move it forward
ph 0ad5a16
working here
ph a605ac5
Update / deploy works
ph 40248b9
cleanup
ph cda83d9
now ok wait check
ph f09b187
correctly work
ph f2a38a6
cleaned
ph 878ea98
one method
ph ff8767d
refactor
ph 3749a1d
it work
ph 4cece4b
move zip outside
ph ad3db4f
You can now remove function on lambda
ph d869dcb
Wait for deletion
ph 3b62460
can generate a stand alone package.
ph 4db9ed0
add headers
ph 44bb82a
Overrides the types of goformation
ph cea697e
no more context in the executor
ph d8d9b1f
use the right default for unreserved concurrency
ph c5e5d2b
Allow overrides
ph d436947
add clougwatch log stream
ph 59b4efc
Make sure that we have write lambda logs to cloudwatch
ph 919cf63
optimize
ph 8082fdd
Update the configuration
ph a18af76
allow to generate a package
ph ba5a9fb
better wording
ph 0743221
first round kvch
ph a94fe85
not needed for this PR
ph f1772be
remove non used code
ph 37166f8
missing test
ph 1a73ddc
Minor: Hide the Registry under feature.GlobalRegistry()
ph c6fd6eb
Minor: Add missing license type
ph 32de16c
Remove: use user defined ignore instead of project ignore.
ph 20fa668
REMOVE: left over comments when debugging the notice generator
ph 8608abb
MINOR: Small corrections in the configuration files
ph 5f8a21c
MINOR: link the max_bulk_size with the max events for queue flush
ph 1b5d79c
MINOR: move the clientFactory inline method into his own function
ph 196790e
MAJOR: it's over 9000
ph 2f5b195
MINOR: refactor, use function pointer instead of redefining the same
ph cec8df9
MINOR: typo
ph 1c6618c
MINOR: use ioutil.ReadCloser and create a wrapper function for
ph e7b3ef8
MINOR: refactor with urso's comments
ph 1460744
MINOR: FeatureRegistry to Registry
ph a6a47b0
MINOR: use Swap
ph 4f4ba1e
MINOR: adjust logging/error
ph 0e9d453
MINOR: check err
ph b8b241a
MINOR: Add random with the host list.
ph ab1ec7a
MINOR: do zero allocation for nullcli
ph 5ed8466
MINOR: formatting + use handler type for AWS functions.
ph 6d799dc
MINOR: Added doc
ph d9a32f4
MINOR: typo
ph d7c0415
MINOR: cleanups
ph 3f932ae
Fix fmt
ph d80ad14
hound comment
ph fd4ab64
CHANGE: make update, deploy and remove top level command.
ph 423a85c
use new uuid library
ph 39ed4cf
uuid again
ph 38c77b7
better formatting for the reference file.
ph bf69342
use a function instead of a method on a struct
ph 417d211
Fix a few issue with logging
ph ea2c451
return directly
ph 72cb211
Ensure capitalization on all logger message are following the
ph 0f84be5
rewording
ph 406b0fa
Better logging messages
ph File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
import json | ||
import csv | ||
import re | ||
import pdb | ||
import copy | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
.vscode | ||
/*/_meta/kibana.generated | ||
beatless | ||
beatless.test | ||
build | ||
data | ||
fields.yml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM golang:1.10.3 | ||
MAINTAINER Pier-Hugues Pellerin <ph@elastic.co> | ||
|
||
RUN set -x && \ | ||
apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
netcat python-pip rsync virtualenv && \ | ||
apt-get clean | ||
|
||
RUN pip install --upgrade setuptools | ||
|
||
# Setup work environment | ||
ENV BEATLESS_PATH /go/src/github.com/elastic/beats/x-pack/beatless | ||
|
||
RUN mkdir -p $BEATLESS_PATH/build/coverage | ||
WORKDIR $BEATLESS_PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ LICENSE=Elastic | |
BEAT_TITLE?=Beatless | ||
SYSTEM_TESTS?=true | ||
BEAT_PATH?=github.com/elastic/beats/x-pack/${BEAT_NAME} | ||
TEST_ENVIRONMENT?=false | ||
TEST_ENVIRONMENT?=true | ||
GOX_FLAGS=-arch="amd64 386 arm ppc64 ppc64le" | ||
ES_BEATS?=../../ | ||
FIELDS_FILE_PATH=module | ||
|
@@ -14,3 +14,9 @@ include $(ES_BEATS)/libbeat/scripts/Makefile | |
# Runs all collection steps and updates afterwards | ||
.PHONY: collect | ||
collect: | ||
|
||
# TODO(ph) This is used for debugging until we change the build to create 2 artifacts, | ||
# we will do this in another PR. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there an issue we can reference? We should create one if not. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will create a followup PR. |
||
.PHONY: linux | ||
linux: | ||
GOOS=linux go build -o pkg/beatless |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
########################## Beatless Configuration ########################### | ||
|
||
# This file is a full configuration example documenting all non-deprecated | ||
# options in comments. For a shorter configuration example, that contains only | ||
# the most common options, please see beatless.yml in the same directory. | ||
# | ||
# You can find the full configuration reference here: | ||
# https://www.elastic.co/guide/en/beats/beatless/index.html | ||
# | ||
#============================ Provider =============================== | ||
# Configure functions to run on AWS Lambda, currently we assume that the credentials | ||
# are present in the environment to correctly create the function when using the CLI. | ||
# | ||
beatless.provider.aws.functions: | ||
# Define the list of function availables, each function required to have a unique name. | ||
- name: fn_cloudwatch_logs | ||
type: cloudwatch_logs | ||
|
||
# Description of the method to help identify them when you run multiples functions. | ||
description: "lambda function for cloudwatch logs" | ||
|
||
# Concurrency, is the reserved number of instances for that function. | ||
# Default is unreserved. | ||
# | ||
# Note: There is a hard limit of 1000 functions of any kind per account. | ||
#concurrency: 5 | ||
|
||
# The maximum memory allocated for this function, the configured size must be a factor of 64. | ||
# There is a hard limit of 3008MiB for each function. Default is 128MiB. | ||
#memory_size: 128MiB | ||
|
||
# Dead letter queue configuration, this must be set to an ARN pointing to a SQS queue. | ||
# dead_letter_config.target_arn: | ||
ph marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Optional fields that you can specify to add additional information to the | ||
# output. Fields can be scalar values, arrays, dictionaries, or any nested | ||
# combination of these. | ||
#fields: | ||
# env: staging | ||
|
||
# List of cloudwatch log group registered to that function. | ||
triggers: | ||
- log_group_name: /aws/lambda/beatless-cloudwatch_logs | ||
filter_pattern: mylog_ | ||
|
||
# Define custom processors for this function. | ||
#processors: | ||
# - dissect: | ||
# tokenizer: "%{key1} %{key2}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,37 @@ | ||
################### Beatless Configuration Example ######################### | ||
###################### Beatless Configuration Example ####################### | ||
|
||
############################# Beatless ###################################### | ||
# This file is an example configuration file highlighting only the most common | ||
# options. The beatless.reference.yml file from the same directory contains all the | ||
# supported options with more comments. You can use it as a reference. | ||
# | ||
# You can find the full configuration reference here: | ||
# https://www.elastic.co/guide/en/beats/beatless/index.html | ||
# | ||
|
||
beatless: | ||
#============================ Provider =============================== | ||
# Configure functions to run on AWS Lambda, currently we assume that the credentials | ||
# are present in the environment to correctly create the function when using the CLI. | ||
# | ||
beatless.provider.aws.functions: | ||
# Accepts events from a cloudwatch log group. | ||
- name: fn_cloudwatch_logs | ||
type: cloudwatch_logs | ||
# The IAM role that the lambda will take when executing your function. | ||
role: iam | ||
# List of cloudwatch streams registered to this function. | ||
triggers: | ||
- log_group_name: /aws/lambda/beatless-cloudwatch_logs | ||
filter_name: myfiltername | ||
filter_pattern: mylog_ | ||
|
||
# Accepts events from a SQS queue. | ||
# - name: fn_sqs | ||
# type: sqs | ||
# | ||
# Accepts events form a Kinesis stream | ||
# - name: fn_kinesis | ||
# type: kinesis | ||
# | ||
# Accepts events from an api gateway proxy call. | ||
# - name: fn_apigateway_proxy | ||
# type: api_gateway_proxy |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported type FeatureRegistry should be of the form "FeatureRegistry ..." (with optional leading article)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment indeed reads somewhat funny.