Skip to content

Commit

Permalink
Adding goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
gfleury committed Jan 25, 2019
1 parent bfbe505 commit a918622
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vscode
coverage.txt
dist/
26 changes: 26 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
builds:
- env:
- CGO_ENABLED=0
archive:
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
files:
- mapping.yaml
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
17 changes: 16 additions & 1 deletion mapping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,25 @@ mappings:
query: SELECT url, COUNT(*) as count, SUM(size) as sum, AVG(size), MAX(response)
FROM log WHERE url LIKE '/surveys/%' AND response > 200 GROUP BY url ORDER BY
count LIMIT 5;
- name: apitimedlog
tables:
- CREATE TABLE log(ip VARCHAR, dt VARCHAR, method VARCHAR, url VARCHAR, version
VARCHAR, response INTEGER, size INTEGER, time_seconds INTEGER, time_miliseconds
INTEGER) WITH FIELDS IDENTIFIED BY '^(?P<ip>\\S+)\\s\\[(?P<dt>[\\w:\\/]+\\s[+\\-]\\d{4})\\]\\s"(?P<method>\\S+)\\s?(?P<url>\\S+)?\\s?(?P<version>\\S+)?"\\s(?P<response>\\d{3}|-)\\s(?P<size>\\d+|-)\\s\\|\\s\\d+\\s\\|\\s(?P<time_seconds>\\d+)\\ss\\s\\|\\s(?P<time_miliseconds>\\d+)\\sus$'
LINES TERMINATED BY '\n';
queries:
- name: responsebyurl
query: SELECT URLIFY(url) as url, COUNT(*) as count, SUM(size) as sum, size, MAX(response)
FROM log GROUP BY url, size ORDER BY count ASC, size DESC LIMIT 20;
- name: likegroup
query: SELECT url, COUNT(*) as count, SUM(size) as sum, AVG(size), MAX(response)
FROM log WHERE url LIKE '/surveys/%' AND response > 200 GROUP BY url ORDER BY
count LIMIT 5;
- name: timedlog
tables:
- CREATE TABLE log(ip VARCHAR, dt VARCHAR, method VARCHAR, url VARCHAR, version
VARCHAR, response INTEGER, size INTEGER, time_seconds INTEGER, time_miliseconds
INTEGER) WITH FIELDS IDENTIFIED BY '^(?P<ip>\\S+)\\s\\[(?P<dt>[\\w:\\/]+\\s[+\\-]\\d{4})\\]\\s"(?P<method>\\S+)\\s?(?P<url>\\S+)?\\s?(?P<version>\\S+)?"\\s(?P<response>\\d{3}|-)\\s(?P<size>\\d+|-)\\s\\|\\s(?P<time_seconds>\\d+)\\ss\\s\\|\\s(?P<time_miliseconds>\\d+)\\sus$'
INTEGER) WITH FIELDS IDENTIFIED BY '^(?P<ip>\\S+)\\s\\[(?P<dt>[\\w:\\/]+\\s[+\\-]\\d{4})\\]\\s"(?P<method>\\S+)\\s?(?P<url>\\S+)?\\s?(?P<version>\\S+)?"\\s(?P<response>\\d{3}|-)\\s(?P<size>\\d+|-)\\s\\|\\s(?P<time_seconds>\\d+)\\ss\\s\\|\\s(?P<time_miliseconds>\\d+)\\sus$'
LINES TERMINATED BY '\n';
queries:
- name: responsebyurl
Expand All @@ -35,6 +49,7 @@ mappings:
query: SELECT url, COUNT(*) as count, SUM(size) as sum, AVG(size), MAX(response)
FROM log WHERE url LIKE '/surveys/%' AND response > 200 GROUP BY url ORDER BY
count LIMIT 5;

- name: internalLog
tables:
- 'CREATE TABLE nonAuth(reason VARCHAR, uri VARCHAR, referer VARCHAR, clientIp VARCHAR,
Expand Down

0 comments on commit a918622

Please sign in to comment.