com.splunk
Class ResultsReaderCsv

java.lang.Object
  extended by com.splunk.ResultsReader
      extended by com.splunk.ResultsReaderCsv
All Implemented Interfaces:
SearchResults, java.lang.Iterable<Event>

public class ResultsReaderCsv
extends ResultsReader

The ResultsReaderCsv class represents a streaming CSV reader for Splunk search results. This class requires the opencsv-2.3.jar file in your build path.


Constructor Summary
ResultsReaderCsv(java.io.InputStream inputStream)
          Class constructor.
 
Method Summary
 void close()
          Closes the reader and returns resources.
 java.util.Collection<java.lang.String> getFields()
          Returns a collection of field names from the results.
 boolean isPreview()
          This method is not supported.
 
Methods inherited from class com.splunk.ResultsReader
getNextEvent, iterator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultsReaderCsv

public ResultsReaderCsv(java.io.InputStream inputStream)
                 throws java.io.IOException
Class constructor. Constructs a streaming CSV reader for the event stream. You should only attempt to parse a CSV stream with this reader. If you attempt to parse a different type of stream, unpredictable results may occur.

Parameters:
inputStream - The CSV stream to parse.
Throws:
java.io.IOException
Method Detail

close

public void close()
           throws java.io.IOException
Closes the reader and returns resources.

Overrides:
close in class ResultsReader
Throws:
java.io.IOException - On IO exception.

isPreview

public boolean isPreview()
This method is not supported.

Returns:
Not applicable.

getFields

public java.util.Collection<java.lang.String> getFields()
Returns a collection of field names from the results.

Returns:
A collection of field names.

Note that any given result will contain a subset of these fields.