results=pyimport("splunklib.results")
kwargs_oneshot = (earliest_time= "2019-09-07T12:00:00.000-07:00",
latest_time= "2019-09-09T12:00:00.000-07:00",
count=0)
searchquery_oneshot = "search index=iis | stats count by c_ip | head 5"
oneshotsearch_results = service.jobs.oneshot(searchquery_oneshot, **kwargs_oneshot)
# Get the results and display them using the ResultsReader
reader = results.ResultsReader(oneshotsearch_results)
for item in reader
println(item)
end
Hmm, actually probably needs a semicolon: oneshot(searchquery_oneshot; kwargs_oneshot...). That way Julia knows they are keyword arguments, not positional ones
Ok. I got a result this time.
Is there like a “dictionary” or Cheatsheet to translate from Julia to Python or viceversa?
Anyways…
These are my results in Python and in Julia.
I want to put that into a dataframe (ex pandas). And visualize it in a map. As I have ipaddresses and latitude and longitude.
The dataframes package in Julia is DataFrames.jl. I know there have been other threads on discourse about mapping visualizations so you might have some luck searching. Best of luck!
Yeah, it’s a little unfortunate that the error message leads you astray in the situation (It’s assuming you’re trying to use ** for exponentiation, which is ^ in Julia).