Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
44 changes: 22 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
BEATNAME=sqlbeat
BEAT_DIR=github.com/adibendahan
BEAT_NAME=sqlbeat
BEAT_PATH=github.com/adibendahan/sqlbeat
BEAT_GOPATH=$(firstword $(subst :, ,${GOPATH}))
BEAT_URL=https://${BEAT_PATH}
SYSTEM_TESTS=false
TEST_ENVIRONMENT=false
ES_BEATS=./vendor/github.com/elastic/beats
Expand All @@ -9,30 +11,28 @@ PREFIX?=.
# Path to the libbeat Makefile
-include $(ES_BEATS)/libbeat/scripts/Makefile

.PHONY: init
init:
glide update --no-recursive
# Initial beat setup
.PHONY: setup
setup: copy-vendor
make update
git init

.PHONY: commit
commit:
git add README.md CONTRIBUTING.md
git commit -m "Initial commit"
git add LICENSE
git commit -m "Add the LICENSE"
git add .gitignore .gitattributes
git commit -m "Add git settings"
git add .
git reset -- .travis.yml
git commit -m "Add sqlbeat"
git add .travis.yml
git commit -m "Add Travis CI"
# .PHONY: init
# init:
# glide update --no-recursive
# make update
# git init

.PHONY: update-deps
update-deps:
glide update --no-recursive
# Copy beats into vendor directory
.PHONY: copy-vendor
copy-vendor:
mkdir -p vendor/github.com/elastic/
-cp -R ${BEAT_GOPATH}/src/github.com/elastic/beats vendor/github.com/elastic/
rm -rf vendor/github.com/elastic/beats/.git

# This is called by the beats packer before building starts
.PHONY: before-build
before-build:

# Collects all dependencies and then calls update
.PHONY: collect
collect:
46 changes: 46 additions & 0 deletions _meta/beat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
################### Sqlbeat Configuration Example #########################

############################# Sqlbeat ######################################

sqlbeat:
# Defines how often an event is sent to the output
period: 10s

# Defines the DB type you are connecting, currently supporting 'mysql' / 'mssql' / 'postgres'
# This attribute is required -- there is no default value.
#dbtype: "mysql"

# Defines the sql hostname that the beat will connect to
#hostname: "127.0.0.1"

# Defines the sql port - leave commented for default ports
#port: "3306"

# MAKE SURE THE USER ONLY HAS PERMISSIONS TO RUN THE QUERY DESIRED AND NOTHING ELSE.
# Defines the mysql user to use
#username: "sqlbeat_user"

# Defines the mysql password to use - option #1 - plain text
#password: "sqlbeat_pass"

# Defines the mysql password to use - option #2 - AES encryption (see github.com/adibendahan/mysqlbeat-password-encrypter)
#encryptedpassword: "2321f38819cf693951e88f00cd82"

# Defines the database to connect, optional for all except DB type postgres
#database: "sqlbeat"

# Defines SSL mode for postgres
#postgressslmode: "disable"

# Defines the queries that will run - the query below is an example
#queries: [ "select * from tbl"]

# Defines the queries result types
# 'single-row' will be translated as columnname:value
# 'two-columns' will be translated as value-column1:value-column2 for each row
# 'multiple-rows' each row will be a document (with columnname:value)
# 'show-slave-delay' will only send the `Seconds_Behind_Master` column from SHOW SLAVE STATUS (for MySQL use)
#querytypes: ["multiple-rows"]

# Colums that end with the following wild card will report only delta in seconds ((neval - oldval)/timediff.Seconds())
#deltawildcard: "__DELTA"
9 changes: 9 additions & 0 deletions _meta/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- key: sqlbeat
title: sqlbeat
description:
fields:
- name: counter
type: long
required: true
description: >
PLEASE UPDATE DOCUMENTATION
6 changes: 6 additions & 0 deletions _meta/kibana/index-pattern/sqlbeat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"fields": "[{\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"beat.name\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"beat.hostname\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"beat.version\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"@timestamp\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"date\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"tags\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"fields\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"meta.cloud.provider\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"meta.cloud.instance_id\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"meta.cloud.machine_type\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"meta.cloud.availability_zone\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"meta.cloud.project_id\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"meta.cloud.region\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"counter\", \"searchable\": true, \"indexed\": true, \"doc_values\": true, \"type\": \"number\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": false, \"name\": \"_id\", \"searchable\": false, \"indexed\": false, \"doc_values\": false, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": true, \"name\": \"_type\", \"searchable\": true, \"indexed\": false, \"doc_values\": false, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": false, \"name\": \"_index\", \"searchable\": false, \"indexed\": false, \"doc_values\": false, \"type\": \"string\", \"scripted\": false}, {\"count\": 0, \"analyzed\": false, \"aggregatable\": false, \"name\": \"_score\", \"searchable\": false, \"indexed\": false, \"doc_values\": false, \"type\": \"number\", \"scripted\": false}]",
"fieldFormatMap": "{\"@timestamp\": {\"id\": \"date\"}}",
"timeFieldName": "@timestamp",
"title": "sqlbeat-*"
}
Loading