Skip to content

Instantly share code, notes, and snippets.

@ruflin
ruflin / example.json
Created December 28, 2018 12:13
Simplified conversion
{
"name" : "ruflin",
"age" : 5,
"social" : {
"github" : "github.com/ruflin",
"twitter" : "twitter.com/ruflin"
},
"kids": ["Linus", "Yuna"],
"nine": 9.0
}

Change meaning of agent.type and service.type

So far service.name was used for things like elasticsearch. APM is putting this information under service.type and service.name is not used yet. .name and .type is also used in other places in ECS. Most of the .name entries are user defined and type is predefined values.

The general suggestion is to make .type the value that will not change over time but .name can. A few examples:

Filebeat Agent reading MySQL logs on production

DELETE ecs
PUT ecs
POST ecs/_mapping/_doc
{
"properties": {
"host.name": {
"type": "keyword"
}

Keybase proof

I hereby claim:

  • I am ruflin on github.
  • I am ruflin (https://keybase.io/ruflin) on keybase.
  • I have a public key whose fingerprint is C861 8985 6895 237F 839A 0B3A F119 702A 2CAE 354A

To claim this, I am signing this object:

@ruflin
ruflin / dynamic-fields.json
Last active March 17, 2016 15:27
Dynamic mapping for name nested docs
{
"fs": {
"disk1": {
"size": 175,
"name": "dis1"
},
"disk2": {
"size": 1785,
"name": "dis2"
}
/*
Beat provides the basic environment for each beat.
Each beat implementation has to implement the beater interface.
# Start / Stop / Exit a Beat
A beat is start by calling the Run(name string, version string, bt Beater) function an passing the beater object.
@ruflin
ruflin / 0_reuse_code.js
Created June 12, 2014 05:49
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ruflin
ruflin / backup.sh
Created March 11, 2012 11:57
Backup mit Duplicity auf S3
#!/bin/bash
# Set ENV variables
export AWS_ACCESS_KEY_ID=YOUR_AWS_ID
export AWS_SECRET_ACCESS_KEY=YOUR_AWS_KEY
export PASSPHRASE="yourpassphrase"
# DEST and PARMS setup
DEST=s3+http://your.bucket.com/possible-sub-folder
PARAMS="--s3-european-buckets --s3-use-new-style --full-if-older-than 2W"
@ruflin
ruflin / Elastica_Log general
Created November 20, 2011 19:56
Write to general PHP log system in Elastica_Log
$client = new Elastica_Client(array('log' => true));
$log = new Elastica_Log($client);
$log->log('hello world');
@ruflin
ruflin / gist:1253270
Created September 30, 2011 09:40
Get has source
curl -XDELETE 'http://localhost:9200/test/'
curl -XPUT 'http://localhost:9200/test/'
curl -XPUT 'http://localhost:9200/test/test/_mapping' -d '
{"test":{"properties":{"firstname":{"type":"string","store":"yes"},"lastname":{"type":"string", "store":"no"}},"_source":{"enabled":false}}}'
curl -XPUT 'http://localhost:9200/test/test/1' -d '
{"firstname":"Nicolas","lastname":"Ruflin"}'