I'm currently trying to use queries I've created and add them to a MySQL database. I've been using the SumoLogic Python SDK to make this as seamless as possible, but I've stumbled into an issue when it comes to doing different queries. For example, whenever I run a query through one source category, I get
[u'San Diego', u'CA', u'longitude', u'United States', u'1', u'US', u'2017-07-28 15:46:49+00:00', u'latitude', u'email']
But through a different query, I get
[u'San Diego', u'2', u'CA', u'email', u'longitude', u'United States', u'US', u'2017-07-28 14:37:59', u'latitude']
As you can see, the ordering is different and causing the python module, MySQLdb, to raise OperationalErrors since it cannot store varchar types in an integer column and other mismatches between the data types.
Is there a way I can control how the output is ordered through the SDK?
For reference, here is how I set up the latter half of all the queries:
| lookup latitude, longitude, country_code, country_name, region, city, postal_code, area_code, metro_code from geo://default on ip = ip
| count by userID, time, latitude, longitude, country_code, country_name, region, city
| sort _count
Please sign in to leave a comment.