<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic XmlException: Unexpected DTD declaration. Line 1, position 3. in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/XmlException-Unexpected-DTD-declaration-Line-1-position-3/m-p/671869#M11301</link>
    <description>&lt;P&gt;When I try to use below code to test the API search:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;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();
}

/// &amp;lt;summary&amp;gt;
/// Called when [search].
/// &amp;lt;/summary&amp;gt;
/// &amp;lt;param name="service"&amp;gt;The service.&amp;lt;/param&amp;gt;
/// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;
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);
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But failed, get the error message:&lt;BR /&gt;XmlException: Unexpected DTD declaration. Line 1, position 3.&lt;BR /&gt;&lt;BR /&gt;Question:&lt;BR /&gt;int this line: new Namespace(user: "nobody", app: "search")&lt;BR /&gt;how to define the "user" and "app" parameters value?&lt;BR /&gt;&lt;BR /&gt;I try to use this way:&lt;BR /&gt;var service = new Service(new Uri("&lt;A href="https://splunk.tesla.cn" target="_blank" rel="noopener"&gt;https://www.splunk.com&lt;/A&gt;"));&lt;BR /&gt;but still failed and got the same error message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2023 09:18:07 GMT</pubDate>
    <dc:creator>jianzgao</dc:creator>
    <dc:date>2023-12-14T09:18:07Z</dc:date>
    <item>
      <title>XmlException: Unexpected DTD declaration. Line 1, position 3.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/XmlException-Unexpected-DTD-declaration-Line-1-position-3/m-p/671869#M11301</link>
      <description>&lt;P&gt;When I try to use below code to test the API search:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;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();
}

/// &amp;lt;summary&amp;gt;
/// Called when [search].
/// &amp;lt;/summary&amp;gt;
/// &amp;lt;param name="service"&amp;gt;The service.&amp;lt;/param&amp;gt;
/// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;
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);
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But failed, get the error message:&lt;BR /&gt;XmlException: Unexpected DTD declaration. Line 1, position 3.&lt;BR /&gt;&lt;BR /&gt;Question:&lt;BR /&gt;int this line: new Namespace(user: "nobody", app: "search")&lt;BR /&gt;how to define the "user" and "app" parameters value?&lt;BR /&gt;&lt;BR /&gt;I try to use this way:&lt;BR /&gt;var service = new Service(new Uri("&lt;A href="https://splunk.tesla.cn" target="_blank" rel="noopener"&gt;https://www.splunk.com&lt;/A&gt;"));&lt;BR /&gt;but still failed and got the same error message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 09:18:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/XmlException-Unexpected-DTD-declaration-Line-1-position-3/m-p/671869#M11301</guid>
      <dc:creator>jianzgao</dc:creator>
      <dc:date>2023-12-14T09:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: XmlException: Unexpected DTD declaration. Line 1, position 3.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/XmlException-Unexpected-DTD-declaration-Line-1-position-3/m-p/671889#M11302</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263330"&gt;@jianzgao&lt;/a&gt;&amp;nbsp;- I think you are using C# SDK for Splunk.&lt;/P&gt;&lt;P&gt;Splunk has made that SDK deprecated -&amp;nbsp;&lt;A href="https://github.com/splunk/splunk-sdk-csharp-pcl" target="_blank"&gt;https://github.com/splunk/splunk-sdk-csharp-pcl&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I would recommend using either Python SDK (&lt;A href="https://github.com/splunk/splunk-sdk-python" target="_blank"&gt;https://github.com/splunk/splunk-sdk-python&lt;/A&gt; ) or Java SDK (&lt;A href="https://github.com/splunk/splunk-sdk-java" target="_blank"&gt;https://github.com/splunk/splunk-sdk-java&lt;/A&gt; ) or Javascript SDK (&lt;A href="https://github.com/splunk/splunk-sdk-javascript" target="_blank"&gt;https://github.com/splunk/splunk-sdk-javascript&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!!!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 12:35:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/XmlException-Unexpected-DTD-declaration-Line-1-position-3/m-p/671889#M11302</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2023-12-14T12:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: XmlException: Unexpected DTD declaration. Line 1, position 3.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/XmlException-Unexpected-DTD-declaration-Line-1-position-3/m-p/671976#M11305</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/93915"&gt;@VatsalJagani&lt;/a&gt;&amp;nbsp;Thank you for your quick reply.&lt;BR /&gt;&lt;BR /&gt;But as a .net platform soft engine, I would like perfer to use the C# SDK. I feel so confuse why deprecate the C# SDK.&amp;nbsp;&lt;BR /&gt;We plan to use C# SDK of splunk to implement some new features.&amp;nbsp;&lt;BR /&gt;Seem like we have to change the solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 00:19:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/XmlException-Unexpected-DTD-declaration-Line-1-position-3/m-p/671976#M11305</guid>
      <dc:creator>jianzgao</dc:creator>
      <dc:date>2023-12-15T00:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: XmlException: Unexpected DTD declaration. Line 1, position 3.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/XmlException-Unexpected-DTD-declaration-Line-1-position-3/m-p/671987#M11307</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263330"&gt;@jianzgao&lt;/a&gt;&amp;nbsp;- If you are just starting to work on a new solution, I &lt;STRONG&gt;won't recommend&lt;/STRONG&gt; using C# as its been no changes to that for a long time. So you would have to end-up maintaining the library yourself, fixing all the issues similar to this one.&lt;/P&gt;&lt;P&gt;I have personally used Python SDK and its most widely used one if you are comfortable using it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!!! Kindly upvote if this helps you!!!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 06:21:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/XmlException-Unexpected-DTD-declaration-Line-1-position-3/m-p/671987#M11307</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2023-12-15T06:21:49Z</dc:date>
    </item>
  </channel>
</rss>

