Skip to content

Commit

Permalink
Merge pull request #432 from neilcook/logstash
Browse files Browse the repository at this point in the history
Update logstash template for elastic to match new format (version 8+)
  • Loading branch information
neilcook authored Aug 7, 2024
2 parents 194df92 + ef89127 commit d58fbc4
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 47 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ AC_ARG_ENABLE([docker],
*) AC_MSG_ERROR([bad value ${enableval} for --enable-docker]) ;;
esac],[docker=false])
AM_CONDITIONAL([WITH_DOCKER], [test x$docker = xtrue])
AC_CHECK_PROG(DOCKER, docker-compose, docker-compose)
AC_CHECK_PROG(DOCKER, docker, docker)
AS_IF([test x$docker = xtrue -a "x$DOCKER" = "x"], [
AC_MSG_ERROR([docker-compose not found, and is required])
AC_MSG_ERROR([docker not found, and is required])
])
AC_ARG_ENABLE([trackalert],
[ --enable-trackalert Build trackalert],
Expand Down
4 changes: 2 additions & 2 deletions docker/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DCMP = docker-compose
DCMP = docker compose
COMPOSE_SOURCE = docker-compose.yml logstash/Dockerfile logstash/config/logstash.conf logstash/templates/wforce_template.json regression/Dockerfile wforce_image/Dockerfile wforce_image/docker-entrypoint.sh wforce_image/wforce.conf.j2 wforce_image/create_config.sh
COMPOSE_TARGET = .docker
REGRESSION_SERVICE = regression
Expand Down Expand Up @@ -27,7 +27,7 @@ clean_elastic: stop
rm $(COMPOSE_TARGET)

clean_docker:
docker-compose down -v
$(DCMP) down -v

clean: clean_docker

Expand Down
110 changes: 69 additions & 41 deletions docker/logstash/templates/wforce_template.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,70 @@
{
"index_patterns" : ["logstash-wforce*"],
"settings" : { "index.refresh_interval" : "5s"},
"mappings" : {
"dynamic_templates" :
[
{
"minor_fields" : {
"match" : "*minor",
"mapping" : { "type" : "integer", "index" : true }
}
},
{
"major_fields" : {
"match" : "*major",
"mapping" : { "type" : "integer", "index" : true }
}
},
{
"string_fields" : {
"match_mapping_type" : "string",
"mapping" : { "type" : "keyword", "index" : true }
}
}
],
"properties" : {
"geoip" : {
"dynamic": true,
"properties" : {
"ip": { "type": "ip" },
"location" : { "type" : "geo_point" },
"latitude" : { "type" : "half_float" },
"longitude" : { "type" : "half_float" }
}
},
"policy_reject": { "type": "boolean" },
"success": { "type": "boolean"},
"tls": { "type": "boolean" },
"t": { "type": "float" }
}
}
{
"index_patterns" : ["logstash-wforce*"],
"template": {
"settings": {
"index.refresh_interval": "5s"
},
"mappings": {
"dynamic_templates": [
{
"minor_fields": {
"match": "*minor",
"mapping": {
"type": "integer",
"index": true
}
}
},
{
"major_fields": {
"match": "*major",
"mapping": {
"type": "integer",
"index": true
}
}
},
{
"string_fields": {
"match_mapping_type": "string",
"mapping": {
"type": "keyword",
"index": true
}
}
}
],
"properties": {
"geoip": {
"dynamic": true,
"properties": {
"ip": {
"type": "ip"
},
"location": {
"type": "geo_point"
},
"latitude": {
"type": "half_float"
},
"longitude": {
"type": "half_float"
}
}
},
"policy_reject": {
"type": "boolean"
},
"success": {
"type": "boolean"
},
"tls": {
"type": "boolean"
},
"t": {
"type": "float"
}
}
}
}
}
4 changes: 2 additions & 2 deletions docker/wforce_image/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DCMP = docker-compose
DCMP = docker compose
WFORCE_IMAGE_COMPOSE_TARGET = .wforce_image_docker
WFORCE_IMAGE_SERVICE = wforce_image
WFORCE_MINIMAL_IMAGE_SERVICE = wforce_minimal
Expand Down Expand Up @@ -27,7 +27,7 @@ kill:
$(DCMP) kill

clean_docker:
docker-compose down -v
$(DCMP) down -v

clean: clean_docker

Expand Down

0 comments on commit d58fbc4

Please sign in to comment.