When I try to use below code to test the API search: var context = new Context(Scheme.Https, "www.splunk.com", 443);
using (var service = new Service(context, new Namespace(user: "nobody", app: "search")))
{
Run(service).Wait();
}
/// <summary>
/// Called when [search].
/// </summary>
/// <param name="service">The service.</param>
/// <returns></returns>
static async Task Run(Service service)
{
await service.LogOnAsync("aaa", "bbb");
//// Simple oneshot search
using (SearchResultStream stream = await service.SearchOneShotAsync("search index=test_index | head 5"))
{
foreach (SearchResult result in stream)
{
Console.WriteLine(result);
}
}
} But failed, get the error message: XmlException: Unexpected DTD declaration. Line 1, position 3. Question: int this line: new Namespace(user: "nobody", app: "search") how to define the "user" and "app" parameters value? I try to use this way: var service = new Service(new Uri("https://www.splunk.com")); but still failed and got the same error message.
... View more