Skip to content

Instantly share code, notes, and snippets.

@Bargs
Bargs / gist:18b8a27958fd4a3152b197abe746b806
Last active December 6, 2019 22:00
nested agg scratch pad, some of these may not even be correct
DELETE shoe_stores
PUT shoe_stores
{
"mappings": {
"properties": {
"store_id": {
"type": "keyword"
},
[
{
"_id": "d9358a40-ddf9-11e8-ab10-17368f702617",
"_type": "visualization",
"_source": {
"title": "test bad",
"visState": "{\n \"title\": \"test bad\",\n \"type\": \"pie\",\n \"params\": {\n \"type\": \"pie\",\n \"addTooltip\": true,\n \"addLegend\": true,\n \"legendPosition\": \"right\",\n \"isDonut\": true,\n \"labels\": {\n \"show\": false,\n \"values\": true,\n \"last_level\": true,\n \"truncate\": 100\n }\n },\n \"aggs\": [\n {\n \"id\": \"1\",\n \"enabled\": true,\n \"type\": \"count\",\n \"schema\": \"metric\",\n \"params\": {}\n },\n {\n \"id\": \"2\",\n \"enabled\": true,\n \"type\": \"filters\",\n \"schema\": \"segment\",\n \"params\": {\n \"filters\": [\n {\n \"input\": {\n \"query\": {\n \"query_string\": {\n \"analyze_wildcard\": true,\n \"query\": \"response:200\"\n
{
"_index": "logstash-2015.09.22",
"_type": "doc",
"_id": "AU_x3_g4GFA8no6QjkYX",
"_version": 14,
"_score": null,
"_source": {
"index": "logstash-2015.09.22",
"type": "apache",
"@timestamp": "2015-09-22T23:50:13.253Z",

Kibana Globalization

Purpose

  • Provide translation readiness on the Kibana dashboard for view text (user data is a separate issue)
  • An integrated framework for federation of multiple globalization frameworks
  • Framework is an agnostic service which is independent of the underlying globalization frameworks, and therefore consumed by those frameworks instead of the translations directly
  • Provide plug-and-play capability (i.e. code free) for localization engineers when providing translations of different languages
  • Delivered in a phased approach
@Bargs
Bargs / 01-query_parameter_original.js
Last active January 18, 2017 23:21 — forked from w33ble/01-query_parameter_original.js
comparing query_parameter_actions
import _ from 'lodash';
const MIN_CONTEXT_SIZE = 0;
const QUERY_PARAMETER_KEYS = Object.keys(createInitialQueryParametersState());
function QueryParameterActionsProvider(config) {
const defaultSizeStep = parseInt(config.get('context:step'), 10);
const setPredecessorCount = (state) => (predecessorCount) => (
>> FAIL: chrome on any platform - kibana - settings app - creating and using Lucence expression scripted fields - should visualize scripted field in vertical bar chart (3492ms)
Error: expected [ 'September 18th 2015, 06:00:00.000 1',
'September 18th 2015, 07:30:00.000 1',
'September 18th 2015, 08:30:00.000 1',
'September 18th 2015, 09:00:00.000 1',
'September 18th 2015, 09:30:00.000 2',
'September 18th 2015, 10:00:00.000 3',
'September 18th 2015, 10:30:00.000 2',
'September 18th 2015, 11:00:00.000 1',
'September 18th 2015, 11:30:00.000 1',
Error: Request to Elasticsearch failed: {"error":{"root_cause":[{"type":"exception","reason":"java.util.concurrent.ExecutionException: AggregationExecutionException[Invalid terms aggregation order path [1]. Terms buckets can only be sorted on a sub-aggregator path that is built out of zero or more single-bucket aggregations within the path and a final single-bucket or a metrics aggregation at the path end.]"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query_fetch","grouped":true,"failed_shards":[{"shard":0,"index":"logstash-0","node":"00s71MPnSRenvz6mflLQeQ","reason":{"type":"exception","reason":"java.util.concurrent.ExecutionException: AggregationExecutionException[Invalid terms aggregation order path [1]. Terms buckets can only be sorted on a sub-aggregator path that is built out of zero or more single-bucket aggregations within the path and a final single-bucket or a metrics aggregation at the path end.]","caused_by":{"type":"execution_exception","reason":"AggregationE

Kibana Globalization Proposal

Purpose

  • Provide translation readiness on the Kibana web-facing UI
  • Delivered in a phased approach

Phase 1

function getFilesRecursivelyFromTopDir(topDir, translationFiles, languageList) {
return readdir(topDir)
.then((topDirectoryListing) => {
return Promise.map(topDirectoryListing, (listing) => {
const fullPath = path.join(topDir, listing);
return stat(fullPath).then((stats) => {
if (stats.isDirectory()) {
console.log('** FullPath **: ' + fullPath + ' is a directory');
getTranslationDetailsFromDirectory(fullPath, translationFiles, languageList);
} else {
@Bargs
Bargs / es.json
Created June 30, 2016 15:01
Proposed synatx for a translation file
{
"management_title": "administración",
"management_version": "versión"
}