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

Convert to Python 3 #674

Merged
merged 28 commits into from
Jan 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
dcb1b13
Convert to Python3
rw-access Dec 4, 2019
b029c78
Update JSON generation to match
rw-access Dec 4, 2019
23a7d05
Make 'nestings' sorted
rw-access Dec 6, 2019
f70d2ad
Merge branch 'master' into py3-conversion
rw-access Dec 6, 2019
08476e0
Add note about Python version
rw-access Dec 19, 2019
f9eebb6
Force venv to pick up python3, when setting up the env
Dec 23, 2019
475107e
Upgrade Python dependencies to most recent
Dec 23, 2019
f611431
Try forcing Python 3.7 in TravisCI
Dec 23, 2019
a58e652
Use load yaml safely
Dec 23, 2019
f04c566
Move to assertEqual
Dec 23, 2019
790444b
Code formatting
Dec 23, 2019
554eca9
Explicitly cast the `map()` result to a list.
Dec 23, 2019
8e27afa
Merge branch 'master' into py3-conversion
Dec 23, 2019
e54a6f2
No need to support 3.6, afaik. We're moving straight to 3.7
Dec 23, 2019
43f8281
Output Python version when running the generator
Dec 23, 2019
b69e86b
Try forcing an install of package python3.7
Dec 23, 2019
c88c8e1
Try Go 1.12
Dec 23, 2019
e11f4dc
Try Go 1.11 again :facepalm:
Dec 23, 2019
b4dfbee
Back to Go 1.13 again
Dec 23, 2019
e5dbeff
Try installing via deadsnake's Python 3.7
Dec 23, 2019
bebd40b
Moar nasty debugging
Dec 23, 2019
0b1c218
Install deadsnake's venv as well
Dec 23, 2019
6638ea2
Try to overwrite the python3 shim with python3.7
Dec 23, 2019
04f3abe
Try switching to a more recent Ubuntu
Dec 24, 2019
b4fe426
Try the 'python' version directive again, on Bionic
Dec 24, 2019
a79bd75
One last try for Travis to run 3.7
Dec 24, 2019
56dce24
Python 3.6+ it is
Dec 24, 2019
f63d44b
Quote the timestamp examples in event.yml
Dec 24, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ language: go
os:
- linux

dist: bionic

go:
- 1.13.x

before_install:
install:
- make setup

addons:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ happen through Pull Requests submitted through Git.
You need these tools to contribute to ECS:

* [Git](https://git-scm.com/)
* [Python 2.7](https://www.python.org/)
* [Python 3.6+](https://www.python.org/)
* [Go 1.13](https://golang.org/)

## Steps to contribute
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ fmt: ve
# Alias to generate everything.
.PHONY: generate
generate: legacy_use_cases codegen generator
$(PYTHON) --version

# Run the new generator
.PHONY: generator
Expand Down Expand Up @@ -107,7 +108,7 @@ test:
.PHONY: ve
ve: build/ve/bin/activate
build/ve/bin/activate: scripts/requirements.txt
@test -d build/ve || virtualenv build/ve
@test -d build/ve || virtualenv -p python3 build/ve
@build/ve/bin/pip install -Ur scripts/requirements.txt
@touch build/ve/bin/activate

Expand Down
4 changes: 2 additions & 2 deletions docs/field-details.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ In case the two timestamps are identical, @timestamp should be used.

type: date

example: `2016-05-23 08:05:34.857000`
example: `2016-05-23T08:05:34.857Z`

| core

Expand Down Expand Up @@ -1256,7 +1256,7 @@ In normal conditions, assuming no tampering, the timestamps should chronological

type: date

example: `2016-05-23 08:05:35.101000`
example: `2016-05-23T08:05:35.101Z`

| core

Expand Down
4 changes: 2 additions & 2 deletions generated/beats/fields.ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@
your agent''s or pipeline''s ability to keep up with your event source.

In case the two timestamps are identical, @timestamp should be used.'
example: 2016-05-23 08:05:34.857000
example: '2016-05-23T08:05:34.857Z'
- name: dataset
level: core
type: keyword
Expand Down Expand Up @@ -1035,7 +1035,7 @@

In normal conditions, assuming no tampering, the timestamps should chronologically
look like this: `@timestamp` < `event.created` < `event.ingested`.'
example: 2016-05-23 08:05:35.101000
example: '2016-05-23T08:05:35.101Z'
default_field: false
- name: kind
level: core
Expand Down
4 changes: 2 additions & 2 deletions generated/csv/fields.csv
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ ECS_Version,Indexed,Field_Set,Field,Type,Level,Example,Description
1.5.0-dev,true,event,event.action,keyword,core,user-password-change,The action captured by the event.
1.5.0-dev,true,event,event.category,keyword,core,authentication,Event category. The second categorization field in the hierarchy.
1.5.0-dev,true,event,event.code,keyword,extended,4648,Identification code for this event.
1.5.0-dev,true,event,event.created,date,core,2016-05-23 08:05:34.857000,Time when the event was first read by an agent or by your pipeline.
1.5.0-dev,true,event,event.created,date,core,2016-05-23T08:05:34.857Z,Time when the event was first read by an agent or by your pipeline.
1.5.0-dev,true,event,event.dataset,keyword,core,apache.access,Name of the dataset.
1.5.0-dev,true,event,event.duration,long,core,,Duration of the event in nanoseconds.
1.5.0-dev,true,event,event.end,date,extended,,event.end contains the date when the event ended or when the activity was last observed.
1.5.0-dev,true,event,event.hash,keyword,extended,123456789012345678901234567890ABCD,Hash (perhaps logstash fingerprint) of raw field to be able to demonstrate log integrity.
1.5.0-dev,true,event,event.id,keyword,core,8a4f500d,Unique ID to describe the event.
1.5.0-dev,true,event,event.ingested,date,core,2016-05-23 08:05:35.101000,Timestamp when an event arrived in the central data store.
1.5.0-dev,true,event,event.ingested,date,core,2016-05-23T08:05:35.101Z,Timestamp when an event arrived in the central data store.
1.5.0-dev,true,event,event.kind,keyword,core,alert,The kind of the event. The highest categorization field in the hierarchy.
1.5.0-dev,true,event,event.module,keyword,core,apache,Name of the module this data is coming from.
1.5.0-dev,false,event,event.original,keyword,core,Sep 19 08:26:10 host CEF:0&#124;Security&#124; threatmanager&#124;1.0&#124;100&#124; worm successfully stopped&#124;10&#124;src=10.0.0.1 dst=2.1.2.2spt=1232,Raw text message of entire event.
Expand Down
4 changes: 2 additions & 2 deletions generated/ecs/ecs_flat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,7 @@ event.created:
agent''s or pipeline''s ability to keep up with your event source.

In case the two timestamps are identical, @timestamp should be used.'
example: 2016-05-23 08:05:34.857000
example: '2016-05-23T08:05:34.857Z'
flat_name: event.created
level: core
name: created
Expand Down Expand Up @@ -1628,7 +1628,7 @@ event.ingested:

In normal conditions, assuming no tampering, the timestamps should chronologically
look like this: `@timestamp` < `event.created` < `event.ingested`.'
example: 2016-05-23 08:05:35.101000
example: '2016-05-23T08:05:35.101Z'
flat_name: event.ingested
level: core
name: ingested
Expand Down
12 changes: 6 additions & 6 deletions generated/ecs/ecs_nested.yml
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,8 @@ client:
group: 2
name: client
nestings:
- geo
- as
- geo
- user
prefix: client.
short: Fields about the client side of a network connection, used with server.
Expand Down Expand Up @@ -1183,8 +1183,8 @@ destination:
group: 2
name: destination
nestings:
- geo
- as
- geo
- user
prefix: destination.
short: Fields about the destination side of a network connection, used with source.
Expand Down Expand Up @@ -1759,7 +1759,7 @@ event:
your agent''s or pipeline''s ability to keep up with your event source.

In case the two timestamps are identical, @timestamp should be used.'
example: 2016-05-23 08:05:34.857000
example: '2016-05-23T08:05:34.857Z'
flat_name: event.created
level: core
name: created
Expand Down Expand Up @@ -1845,7 +1845,7 @@ event:

In normal conditions, assuming no tampering, the timestamps should chronologically
look like this: `@timestamp` < `event.created` < `event.ingested`.'
example: 2016-05-23 08:05:35.101000
example: '2016-05-23T08:05:35.101Z'
flat_name: event.ingested
level: core
name: ingested
Expand Down Expand Up @@ -5335,8 +5335,8 @@ server:
group: 2
name: server
nestings:
- geo
- as
- geo
- user
prefix: server.
short: Fields about the server side of a network connection, used with client.
Expand Down Expand Up @@ -5861,8 +5861,8 @@ source:
group: 2
name: source
nestings:
- geo
- as
- geo
- user
prefix: source.
short: Fields about the source side of a network connection, used with destination.
Expand Down
Loading