question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WorldMap - w/ MySQL DB

See original GitHub issue

Hi all,

I’m trying to get my DB stats on the wroldmap plugin, but i’m using MySQL query.

AS you can see my query :

SELECT UNIX_TIMESTAMP(when) as time_sec, ( SELECT FORMAT( COUNT( * ) , 0 ) AS count FROM logged ) as value, gateway as metric FROM logged WHERE $__timeFilter(when) ORDER BY when ASC

I do a count on my table logged to get all user connected but i don’t have column to identify the location however i’ve “gateway” column which identify the gateway where user is logged but doesn’t work. How i can use my column gateway as location (France, Espagne,…)

Thanks in advance.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:25 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
bontchevcommented, Nov 18, 2017

Never mind, figured it out. I need a query like this:

SELECT
  city_name AS City,
  geohash AS Geohash,
  COUNT(*) AS Count
FROM location
WHERE $__timeFilter(timestamp)
GROUP BY Geohash

then format as Table (instead of as time series) and finally in the Map Data Options, set Location Data to geohash and the ES Location Name Field as City.

2reactions
ssnkhancommented, Jan 10, 2018

Hi,

The World Map needs 3 values, in the following order: time, metric and value. Try the following:

select timestamp AS time, country AS metric, count(*) as value …

Change the time stamp to the column containing time data.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Worldmap panel with MySQL database
Hi,. I am trying to connect Worldmap panel/plugin with MySQL. Could I use MySQL table with float numbers for longitude and latitude data?...
Read more >
Grafana worldmap panel: latitude and longitude in mysql ...
I am using a worldmap panel on Grafana v5.4.2, my data source is a mysql database, and there I have some ip address,...
Read more >
Worldmap Panel Plugin for Grafana
The Worldmap Panel is a tile map of the world that can be overlaid with ... from a database query: Prometheus, InfluxDB, Graphite,...
Read more >
Other MySQL Documentation
Example Databases · employee data (large dataset, includes data and test/verification suite) · world database · world_x database · sakila database · airportdb ......
Read more >
Use Google Maps With Mysql Database - YouTube
Hallo Gys this Video shows you how to user google map in your project for drawing path with datasets from mysql database and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found