Grafana heatmap: hide y-axis labels - label

I am creating a heatmap from 201 data fields coming from an Influx-DB. Currently, the result looks like this:
Is it possible to hide the y-axis tick-labels in this visualization? In the JSON I set show to false:
"yAxis": {
"decimals": null,
"format": "short",
"logBase": 1,
"max": null,
"min": null,
"show": false,
"splitFactor": null
},
But this does not have the desired effect. If possible, I would like to switch off the grid lines too...

You can hide the Y-Axis Labels using the Alias by JSON field , writing a space into that field.
"targets": [
{
"alias": "",
default Result
"targets": [
{
"alias": " ",
result

Related

how make a calculation with elastic document fields?

I need to make some calculation with each doc's some fields and then return it as response's part
I've written this
TermsAggregationBuilder subAggregation = AggregationBuilders
.terms("price")
.script(new Script(ScriptType.INLINE, "painless",
" int total = 0;\n" +
" for (int i = 0; i < 5; ++i) {\n" +
" total += doc['age'].value;\n" +
" }\n" +
" return total ;\n"
, Collections.emptyMap()));
NativeSearchQuery nativeSearchQuery = new NativeSearchQueryBuilder()
.withQuery(matchAllQuery())
.addAggregation(subAggregation)
.build();
SearchHits<Stories>
searchHits = elasticsearchOperations.search(nativeSearchQuery, Stories.class
, IndexCoordinates.of("long_stories"));
and this returns this one
{
"totalHits": 1,
"totalHitsRelation": "EQUAL_TO",
"maxScore": 1,
"scrollId": null,
"searchHits": [
{
"id": "44",
"score": 1,
"sortValues": [],
"content": {
"id": "44",
"innerId": 5,
"age": 44,
"salary": 433,
"mark": 10,
"state": "state",
"stores": [
{
"storiesId": "44",
"innerId": 1
},
{
"storiesId": "44b",
"innerId": 2
},
{
"storiesId": "44c",
"innerId": 3
}
],
"esh": null
},
"highlightFields": {}
}
],
"aggregations": {
"asMap": {
"price": {
"name": "price",
"metadata": null,
"buckets": [
{
"aggregations": {
"asMap": {},
"fragment": true
},
"keyAsString": "220",
"docCount": 1,
"docCountError": 0,
"key": "220",
"keyAsNumber": 220,
"fragment": true
}
],
"type": "sterms",
"docCountError": 0,
"sumOfOtherDocCounts": 0,
"fragment": true
}
},
"fragment": true
},
"empty": false
}
this response gives separate calculation I need it to be with above part ,and also if key which is 220 now if I had some another doc which would give the same answer then response would print 220 and doc count 2 I need it to be separately and in above response
like doc1 220 doc2 220 and in above response where actual data holds
Terms aggregation works as "group by".
So it will have only unique keys and documents clubbed under those keys. If you need it on per document basis use scripted field in query instead of aggregation.
With scripted field you will need to specify "source" to fetch rest of the document.
You can also explore runtime field in place of scripted field. It offer some benefits over scripted field
You can use script fields to access values in _source and return
calculated values based on a script valuation. Runtime fields have
these same capabilities, but provide greater flexibility because you
can query and aggregate on runtime fields in a search request. Script
fields can only fetch values.

Problem with WebDataRocks Pivot Table captions in rows, columns, measures

I have 3 questions about captions (data localizations):
How to provide caption for a field not included in slice object
Why are captions ignored in: toolbar -> fields -> all fields -> any measure field
Why are captions ignored while adding calculated value: toolbar -> fields -> add calculated value -> any row or column field
Check out this js fiddle
var pivot = new WebDataRocks({
container: "#wdr-component",
toolbar: true,
height: 395,
report: {
dataSource: {
filename: "https://cdn.webdatarocks.com/data/data.csv"
},
"slice": {
"rows": [{
"uniqueName": "Category",
"caption": "Category_Localized"
}
],
"columns": [{
"uniqueName": "Color",
"caption": "Color_Localized"
}],
"measures": [{
"uniqueName": "Price",
"aggregation": "sum",
"caption": "Price_Localized"
}
]
}
}
});
It seems like all these features are currently not working as expected.
As a workaround to the first question though you can simply change the field names in the CSV file you're feeding to the pivot table.

Is it possible to rename the fields on message triggered running of debezium mysql connector?

I have configured a debezium mysql connector, I need to include additonal field as table name in the payload. What configuration change i need to do achieve this ?
The table name is already included, in the source.table element. Here's a sample message of an insert to a table called rental:
{
"before": null,
"after": {
"fullfillment.sakila.rental.Value": {
"rental_id": 13346,
"rental_date": 1124483301000,
"inventory_id": 4541,
"customer_id": 131,
"return_date": {
"long": 1125188901000
},
"staff_id": 2,
"last_update": "2006-02-15T21:30:53Z"
}
},
"source": {
"name": "fullfillment",
"server_id": 0,
"ts_sec": 0,
"gtid": null,
"file": "mysql-bin.000002",
"pos": 832,
"row": 0,
"snapshot": {
"boolean": true
},
"thread": null,
"db": {
"string": "sakila"
},
"table": {
"string": "rental"
}
},
"op": "c",
"ts_ms": {
"long": 1518190060267
}
}
If you want to insert additional fields you can use the InsertField$Value Single Message Transform, which you can see an example of in this article.
Edit:
If you want the field in a different part of the message you have a few options. You could post-process the data with Kafka Streams to restructure it as you desire. You could use available Single Message Transform to flatten the after component and then add in static values:
"transforms": "unwrap,InsertTopic,InsertSourceDetails",
"transforms.unwrap.type": "io.debezium.transforms.UnwrapFromEnvelope",
"transforms.InsertTopic.type":"org.apache.kafka.connect.transforms.InsertField$Value",
"transforms.InsertTopic.topic.field":"messagetopic",
"transforms.InsertSourceDetails.type":"org.apache.kafka.connect.transforms.InsertField$Value",
"transforms.InsertSourceDetails.static.field":"messagesource",
"transforms.InsertSourceDetails.static.value":"Debezium CDC from Oracle on asgard"
Or you could write your own Single Message Transform to do exactly the modifications you're wanting to do.

ElasticSearch URI Search null field

I need to create a query via URI to filter all data between two dates and also if this date field is null.
For example:
I have the field "creation_date" in some objects, however I want that in the resulting also does not appear the objects that the field does not have.
I tried something similar below:
http://localhost//elasticsearch/channels/channel/_search?q=channel.schedule.creation_date:[2018-06-19 TO 2018-12-22] OR channel.schedule.creation_date: NULL
As far as comparing the dates is OK, it works. The problem is to get the NULL values.
Edited
Source sample:
"_source": {
"channel": {
"activated": false,
"approved": false,
"content": "Jvjv",
"creation_date": "2018-06-21T13:06:10.000Z",
"facebookLink": "J jv",
"id": "Kvjvjv",
"instagramId": "Jvjv",
"name": "Kbkbkvk",
"ownerId": "sZtxdhiNbNY9sr2DtiCzlgJfsqb2",
"plan": 0,
"purpose": "Jvjv",
"recurrence": 1,
"segment": "Jvjvjv",
"twitterId": "Jvjv",
"youtubeId": "Jvj"
}
}
}
You can do this using the NOT(_exists_:field_name) constraint:
Can you try this ?
http://localhost//elasticsearch/channels/channel/_search?q=channel.schedule.creation_date:[2018-06-19 TO 2018-12-22] OR NOT(_exists_:channel.schedule.creation_date)

amCharts, non-numeric yaxis and dates

I want to plot a graph between place and time. Y-axis will show 5 countries (USA, UK, Canada, France, Germany) and X-axis will show the time. The data is in pairs of (date, place). I am trying to display it by replacing the numeric values of Y-Y-axis with strings but no luck. Any simple working example will be helpful.
The value axis' labelFunction would be perfect for this task. With it, you can define a custom function that would be called for each label, which in turn could replace the number with a string. I.e.:
"valueAxes": [{
// other value axis settings
// ...
"labelFunction": function(value) {
var labels = {
"1": "USA",
"2": "UK",
"3": "Canada",
"4": "France",
"5": "Germany"
};
return labels[value] || "";
}
}]
Another option that you have is to disable value axis labels altogether ("labelsEnabled": false) and using guides to place country labels at specific values. I.e.:
"valueAxes": [{
"labelsEnabled": false,
"guides": [{
"value": 1,
"label": "USA"
}, {
"value": 2,
"label": "UK"
}, {
"value": 3,
"label": "Canada"
}, {
"value": 4,
"label": "France"
}, {
"value": 5,
"label": "Germany"
}]
}]
Whichever works for your purposes better, or seems easier.

Resources