All Apps and Add-ons

GeoASN app search generates red error bar. How to resolve?

sonicZ
Contributor

I've got the GeoASN application installed in our distributed environment(4 indexers so far 1 search head) running the script seems to be generating the generic red error bar saying "results may be incorrect"
Search used:

index=www sourcetype=access_combined splunk_server="splunk*-d*" | lookup ga ip AS clientip | stats count by country, org

error is as follows

Script for lookup table 'ga' returned error code 1. Results may be incorrect

How do we go about troubleshooting this and resolving the error? I am checking python.log web_access and web_service so far nothing pops out as to what the problem is.
basically want to either resolve or in the meantime squelsh the error until we can resolve it.

Tags (2)

jonrsplunk
Explorer

I did a GeoASN install in a distributed environment today and had sismilar problems.
Solution: Install all the components (listed in the README) and the app on all searchheads and indexers.

0 Karma

mathu
Path Finder

There seems to be a problem with character encoding. i.e. if you lookup countries like "Curaçao", the script will fail because of "ç"

I worked around the problem by changing following line in "ga.py":

replace line:

line[countryi] = unicode(gir['country_name'])

with following two lines:

t = gir['country_name'].decode('cp1252')
line[countryi] = unicode(t)

myron_davis
Path Finder

This has to be deployed to all of the python scripts. i.e. for geoasn.py:

before:
line[src_countryi] = unicode(src_gir['country_name'])

after:
t = src_gir['country_name'].decode('cp1252')
line[src_countryi] = unicode(t)

and

before:
line[dest_countryi] = unicode(dest_gir['country_name'])

after:
t = dest_gir['country_name'].decode('cp1252')
line[dest_countryi] = unicode(t)

Thank you for solving my problem as well.

0 Karma

theeansible
Path Finder

Unfortunately I tried this solution and it still doesn't fix my issue. I followed the guide step by step and was still unable to get it to work.

The weird thing is that it works through the command line however it does not work at the search bar 😕 not sure what else to do.

0 Karma

cnygaard
New Member

I got the same error message as you, you will need to install GeoIP and GeoIP python module
take a look in /opt/splunk/etc/apps/GeoASN/README

after that verify that this command works
/opt/splunk/bin/splunk cmd python ga.py < ga.csv

you also need to include the field src_asn in the search results.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...