Archive
Highlighted

writing to csv using java sdk affect performance?

New Member

Hi,

I am exporting search results to csv using java sdk ,from then to mysql database.sometimes it is writing to csv and sometimes not.Searches are monitoring in real-time and triggeraing alerts and running scripts to write to csv and to database.Why it is not writing to csv sometimes?
Tags (1)
0 Karma
Highlighted

Re: writing to csv using java sdk affect performance?

Ultra Champion

When you say "write to CSV" are you receiving your Splunk search results in CSV format(Splunk Java SDK) then writing to a CSV file on disk(not the Splunk Java SDK), and the written file is missing results ? Please clarify.

0 Karma
Highlighted

Re: writing to csv using java sdk affect performance?

New Member

While scheduling search,i am running a script (using java sdk) to write the search results to CSV .Issue is sometimes it is running script and writing to csv and sometimes not.If i run that script manually it is writing results to csv.what is the reason?

0 Karma
Highlighted

Re: writing to csv using java sdk affect performance?

New Member

First of all study about the csv and java sdk after that do the work.Many java and csv tutorials are available on the internet.You can refer the good source like best essay writing service and other resources.If you have good tutorials then you can easily write the csv and java sdk program.

0 Karma

Re: writing to csv using java sdk affect performance?

Explorer

I down voted this post because a reference url to one of the resources you suggest would be help , is appropriate otherwise this comment does not help anyone here on splunk forum.

0 Karma
Highlighted

Re: writing to csv using java sdk affect performance?

New Member

@theoborrero Hey, iam trying to do the same ecporting search results in xml/json format using splunk sdk java..but my script is not returning any output in console..could you please help me on it.

MultiResultsReaderXml multiResultsReader = new MultiResultsReaderXml(stream);
try {

                int counter = 0;  // count the number of events
                for (SearchResults searchResults : multiResultsReader) {
                    for (Event event : searchResults) {
                        System.out.println("***** Event " + counter++ + " *****");
                        for (String key : event.keySet())
                            System.out.println("   " + key + ":  " + event.get(key));

                    }
                }
                multiResultsReader.close();
            }
0 Karma