Activity Feed
- Posted C# SDK exception : System.Net.WebException: The request was aborted: The request was canceled. on Splunk Dev. 01-30-2014 12:58 AM
- Tagged C# SDK exception : System.Net.WebException: The request was aborted: The request was canceled. on Splunk Dev. 01-30-2014 12:58 AM
- Tagged C# SDK exception : System.Net.WebException: The request was aborted: The request was canceled. on Splunk Dev. 01-30-2014 12:58 AM
- Tagged C# SDK exception : System.Net.WebException: The request was aborted: The request was canceled. on Splunk Dev. 01-30-2014 12:58 AM
- Posted Re: Search using C# sdk is returning only 50000 events on Splunk Search. 01-17-2014 03:42 AM
- Posted Search using C# sdk is returning only 50000 events on Splunk Search. 01-16-2014 10:52 PM
- Tagged Search using C# sdk is returning only 50000 events on Splunk Search. 01-16-2014 10:52 PM
- Posted Re: Calling rest API from C# SDK on Getting Data In. 01-16-2014 10:18 PM
- Posted Calling rest API from C# SDK on Getting Data In. 01-15-2014 11:09 PM
- Tagged Calling rest API from C# SDK on Getting Data In. 01-15-2014 11:09 PM
- Posted Need help in calling Saved Search and export results to CSV using C# Splun SDK. on Reporting. 01-15-2014 10:24 PM
- Tagged Need help in calling Saved Search and export results to CSV using C# Splun SDK. on Reporting. 01-15-2014 10:24 PM
- Tagged Need help in calling Saved Search and export results to CSV using C# Splun SDK. on Reporting. 01-15-2014 10:24 PM
- Posted Search for multiple keywords. on Splunk Search. 12-18-2013 11:26 PM
- Tagged Search for multiple keywords. on Splunk Search. 12-18-2013 11:26 PM
- Tagged Search for multiple keywords. on Splunk Search. 12-18-2013 11:26 PM
- Tagged Search for multiple keywords. on Splunk Search. 12-18-2013 11:26 PM
Topics I've Started
Subject | Karma | Author | Latest Post |
---|---|---|---|
0 | |||
0 | |||
0 | |||
0 | |||
0 |
01-30-2014
12:58 AM
Hi,
I am trying to call a Saved search using C# SDK as below.
SavedSearchCollection coll = service.GetSavedSearches();
SavedSearch SplunkSearch = service.GetSavedSearches().Get("SavedSearchName");
Job searchJob = SplunkSearch .Dispatch();
while (!searchJob.IsDone)
{
try
{
Thread.Sleep(500);
}
catch (Exception ex)
{
}
}
I am getting the following exception while trying to execute while (!searchJob.IsDone).
System.Net.WebException: The request was aborted: The request was canceled. at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Xml.XmlTextReaderImpl.ReadData() at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars) at System.Xml.XmlTextReaderImpl.ParseText() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at System.Xml.XmlDocument.Load(Stream inStream) at Splunk.AtomEntry.Parse(Stream input) at Splunk.Job.Refresh() at Splunk.Job.get_IsDone() at SplunkDataPull.FetchData.Fetchdata()
Note:The issues is not occurring every time.Few runs are running without any issues few runs are throwing this exception.
Please help
... View more
- Tags:
- c
- netexception
- sdk
01-17-2014
03:42 AM
Thanks for your reply.
I tried paginate option and with this i was able to download 500,000 events where as in reality web interface is returning me 703,186 events.
Is there any other way on getting the remaining records as well.
Job.ResultCount is returning value as 500,000 only.
Pelase help.
... View more
01-16-2014
10:52 PM
Hi,
From Splunk web interface a saved search is returning around 300,000+ events. While calling the same saved search from C# SDk it is returning only 50,000 events.
Please help me on why i am getting only 50,000 events and how can i read remaining events.
Below is the code that i am referring to.
var connectArgs = new ServiceArgs
{
Host = "myhost.com",
Port = myportNumber
};
// Create new Service object
Service service = new Service(connectArgs);
service.Login("admin", "password");
SavedSearch ObsSearch = service.GetSavedSearches().Get("SavedSearchName");
Job searchJob = ObsSearch.Dispatch();
while (!searchJob.IsDone)
{
try
{
Thread.Sleep(500);
}
catch (Exception ex)
{
Console.WriteLine("Exception Occured :" + ex.ToString());
Console.ReadLine();
}
}
JobResultsPreviewArgs previewArgs = new JobResultsPreviewArgs();
previewArgs.OutputMode = JobResultsPreviewArgs.OutputModeEnum.Xml;
previewArgs.Count = 0;
int count = 0;
using (var stream = searchJob.ResultsPreview(previewArgs))
{
using (var rr = new ResultsReaderXml(stream))
{
foreach (var @event in rr)
{
count ++;
}
}
}
System.Console.WriteLine("Total events " + count.ToString())
Thanks in advance.
Regards,
Mohan
... View more
- Tags:
- maxresultrows
01-15-2014
11:09 PM
Hi all,
Please help in letting me know on how can i call a SPLUNK REST API from C#.
My requirement is i need to call SPLUNK rest API and store results in a csv file.
Even windows commands also work with me.
Thanks in advance.
... View more
- Tags:
- restapi
01-15-2014
10:24 PM
Hi,
I am using Splunk C# SDK to query SPLUNK database. I have created a saved search which fullfills my search criteria.
Now I need help in writing a piece of code to call the Saved Search and export results to CSV using C# SDK.
Please help.
... View more
12-18-2013
11:26 PM
Hi,
I want to do a search having multiple strings.
Example: Consider,I am looking for SearchKey1 and SerachKey2
In SQL i will write something like this
Select * from Table_Name where ColumnName like '%SearchKey1%' and ColumnName like '%SerachKey2%'
IN SQL the above query returns me all the rows having both search keys SearchKey1 and SearchKey2 in it.
I want to achieve similiar kind of search in SPLUNK. Please help me with appropriate code.
... View more