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
filter { | |
if [type] == "elasticsearch" { | |
grok { | |
match => [ "message", "\[%{TIMESTAMP_ISO8601:timestamp}\]\[%{DATA:severity}%{SPACE}\]\[%{DATA:source}%{SPACE}\]%{SPACE}(?<message>(.|\r|\n)*)" ] | |
overwrite => [ "message" ] | |
} | |
if "_grokparsefailure" not in [tags] { | |
grok { # regular logs | |
match => [ |
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
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: securityconfig-secret | |
type: Opaque | |
stringData: | |
internal_users.yml: |- | |
_meta: | |
type: "internalusers" | |
config_version: 2 |
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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: zk-hs | |
labels: | |
app: zk | |
spec: | |
ports: | |
- port: 2888 | |
name: server |
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
<!-- NOTE: if you landed here by accident, look for Solr plugin under https://sematext.com/blog and you'll get the context --> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.example.mysortplugin</groupId> | |
<artifactId>mysortplugin</artifactId> |
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
#!/bin/bash | |
#shows traffic on the specified device | |
function human_readable { | |
VALUE=$1 | |
BIGGIFIERS=( B K M G ) | |
CURRENT_BIGGIFIER=0 | |
while [ $VALUE -gt 10000 ] ;do | |
VALUE=$(($VALUE/1000)) |
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
curl -XDELETE localhost:9200/test/ | |
curl -XPUT localhost:9200/test/ | |
curl -XPUT localhost:9200/test/son/_mapping -d '{ | |
"son": { | |
"_parent": { | |
"type": "mother" | |
} | |
} | |
}' | |
curl -XPUT localhost:9200/test/daughter/_mapping -d '{ |
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
#!/usr/bin/env bash | |
###############FUNCTIONS############ | |
function prepare { | |
#optimize the index | |
echo -n "Optimizing index $INDEX_NAME..." | |
curl -XPOST "$ADDRESS/$INDEX_NAME/_optimize" 2>/dev/null| grep 'failed":0' >/dev/null | |
if [ $? -eq 0 ]; then | |
echo "done" |
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
#cleanup first | |
curl -XDELETE localhost:9200/test/ | |
echo | |
#create index | |
curl -XPUT localhost:9200/test | |
echo | |
#create parent type | |
curl -XPUT localhost:9200/test/test_parent |
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
curl -XDELETE localhost:9200/test1 | |
curl -XPUT localhost:9200/test1 | |
curl -XPUT localhost:9200/test1/test/_mapping -d '{ | |
"test": { | |
"properties": { | |
"foo": { | |
"type": "string", | |
"index": "not_analyzed" | |
} | |
} |
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
$ cat req | |
{ "index" : { "_type" : "type1", "_id" : "1" } } | |
{ "field1" : "value1" } | |
{ "index" : { "_type" : "type1", "_id" : "2" } } | |
{ "field1" : "value2" } | |
$ curl -XPOST localhost:9200/testing/_bulk?pretty=true --data-binary @req | |
{ | |
"took" : 5, | |
"items" : [ { | |
"index" : { |
NewerOlder