Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

MultipleTargets not working #6

Open
mhussain opened this issue Apr 27, 2017 · 6 comments
Open

MultipleTargets not working #6

mhussain opened this issue Apr 27, 2017 · 6 comments
Assignees
Labels

Comments

@mhussain
Copy link

mhussain commented Apr 27, 2017

Based on the tooltip info for location data

I entered the data as

{"location1": [lat1, lon1], "location2": [lat2, lon2]}

But the console keeps showing the error

TypeError: Cannot read property 'lat' of undefined
    at kibana.bundle.js?v=10229:82769
    at commons.bundle.js?v=10229:45562
    at completeOutstandingRequest (commons.bundle.js?v=10229:33214)
    at commons.bundle.js?v=10229:33491

Which is essentially this line

if (config.multipleTargets) {
  var targetCoords = getCoords([event.target.lat, event.target.lon]);

Any ideas? :(

@xarkes
Copy link
Contributor

xarkes commented Apr 27, 2017

I'm a bit busy now I'll give a look this week end

@xarkes
Copy link
Contributor

xarkes commented May 15, 2017

Sorry, I've been busy those days, I did not have the time to check, neither to install a running version of Kibana on my laptop. I don't remember how I did implement it, but I think the help message is wrong. According to those lines:

      var targetAggId;
      try {
        targetAggId = vis.aggs.bySchemaName['target'][0].id;
      } catch (err) {
        console.log("Target location is not set.");
      }
[...]
        var id = table.columns[i].aggConfig.id;
        switch (id) {

[...[
          case targetAggId:
            targetColumn = i;
            break;
        }
[...]
        if (targetColumn >= 0) {
          data['target'] = geohash.decode(row[targetColumn].key);
        }

This refers to the aggregation named target which means that you need one GeoHash for the event origin coordinates, and another GeoHash for the targeted coordinates.
So yes the help message is wrong, I should fix it, but to be clear, if you uncheck the multipleTargets box, then it looks for the GeoHash field you set in the target aggregate.
I hope it's more clear, since I did not test it let me know if anything is wrong.

@Amorik
Copy link

Amorik commented May 29, 2017

@xarkes when you say "So yes the help message is wrong" you are referring to "Multiple targets" help box:

If the attacks should point to different targets, then select this. If you uncheck it, then the targets will point to the same unique location. Values true: use multiple directions false: use only one direction

yes? If so, to be clear, you are saying the option is inverted? i.e. to use multiple locations uncheck the "Multiple targets" box, not check it?

In doing so I have encountered the following errors:

Error: atribute d: Expected number, "….09007377295427LNaN,NaN".

Uncaught TypeError: Cannot read property 'removeChild' of null
at destroyPurpleBox (purplebox.js:36)
at purplebox.js:51

image

The console also notes that "Target location is not set".

@xarkes
Copy link
Contributor

xarkes commented May 30, 2017

Unfortunately I am unable to test it right now and give you a proper solution.
I think the correct way is to add the aggregation named "Target location" (target) and to check the box "Multiple targets" and just ignore the one named "Target coordinates" (keep the default value).
So this requires each of your event to have an origin geohash and a destination geohash.
Try with this and let me know

@TRISAF
Copy link

TRISAF commented Jun 25, 2017

Please Xarkes,
i have multiple traget location in a geo_point location, can you explain me how to use it.
I'can see multi direction lines in the world map.

Many Thanks

@xarkes
Copy link
Contributor

xarkes commented Jun 26, 2017

As I said in my previous message, try to use one geohash for the "Coordinates" aggregate and another one for "Target location" aggregate. Then check the box "Multiple targets" in the parameters. This should work fine.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants