<?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 In my Splunk developed app, everything works fine on Linux, but why is an extra line added to the beginning of all config files on Windows? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/In-my-Splunk-developed-app-everything-works-fine-on-Linux-but/m-p/211154#M41573</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;

&lt;P&gt;I am currently facing the following problem: In my Splunk developed APP, on Linux everything seems to be working fine. However, when I switch to Windows, I always get an extra line at the beginning of all the config files being written with the &lt;CODE&gt;$APP_HOME$/local/&lt;/CODE&gt; directory. This extra line always causes the app to crash with the following exception being triggered:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;EXCEPTION: [File contains no section headers.]&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Any ideas??&lt;/P&gt;

&lt;P&gt;Thanks a lot in advance!&lt;/P&gt;</description>
    <pubDate>Mon, 02 Nov 2015 16:57:04 GMT</pubDate>
    <dc:creator>mostafaelsaie</dc:creator>
    <dc:date>2015-11-02T16:57:04Z</dc:date>
    <item>
      <title>In my Splunk developed app, everything works fine on Linux, but why is an extra line added to the beginning of all config files on Windows?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-my-Splunk-developed-app-everything-works-fine-on-Linux-but/m-p/211154#M41573</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;

&lt;P&gt;I am currently facing the following problem: In my Splunk developed APP, on Linux everything seems to be working fine. However, when I switch to Windows, I always get an extra line at the beginning of all the config files being written with the &lt;CODE&gt;$APP_HOME$/local/&lt;/CODE&gt; directory. This extra line always causes the app to crash with the following exception being triggered:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;EXCEPTION: [File contains no section headers.]&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Any ideas??&lt;/P&gt;

&lt;P&gt;Thanks a lot in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2015 16:57:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-my-Splunk-developed-app-everything-works-fine-on-Linux-but/m-p/211154#M41573</guid>
      <dc:creator>mostafaelsaie</dc:creator>
      <dc:date>2015-11-02T16:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: In my Splunk developed app, everything works fine on Linux, but why is an extra line added to the beginning of all config files on Windows?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-my-Splunk-developed-app-everything-works-fine-on-Linux-but/m-p/211155#M41574</link>
      <description>&lt;P&gt;How are you creating your files on Linux (what editor)? Sounds like you may be having one of two problems, UTF-8 BOM issues or a line ending issue.&lt;/P&gt;

&lt;P&gt;(&lt;A href="https://en.wikipedia.org/wiki/Byte_order_mark"&gt;BOM&lt;/A&gt;, or Byte Order Mark (U+FEFF), is a Unicode character "magic number" to ID info about the text stream following. In vi:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;:set nobomb
:wq
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In emacs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;C-x RET f
utf-8
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;C-x RET f&lt;/CODE&gt; is the default binding for &lt;CODE&gt;set-buffer-file-coding-system&lt;/CODE&gt;, you are changing from &lt;CODE&gt;utf-8-with-signature&lt;/CODE&gt; to plain &lt;CODE&gt;utf-8&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;As for line endings, a different sequence of characters is used to signify an end of a line between *NIX and Windows. On Unix, it’s the LF character (\n, 0A or 10 in decimal). On Windows, it’s a sequence of two characters, CR and LF (\r + \n, 0D + 0A or 13 + 10 in decimal).&lt;/P&gt;

&lt;P&gt;Try converting the configuration files to Windows line endings. On Windows: &lt;CODE&gt;TYPE input_filename | MORE /P &amp;gt; output_filename&lt;/CODE&gt; On Linux  you can use unix2dos, &lt;CODE&gt;awk 'sub("$", "\r")' unixfile.txt &amp;gt; winfile.txt&lt;/CODE&gt;, or when editing the file in vi:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;:set fileformat=dos
:wq
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or in emacs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;M-x set-buffer-file-coding-system utf-8-dos
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If it turns out to be a BOM problem, I would file a bug. Splunk on Windows should correctly handle them, since BOMs are a MS invention.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2015 17:39:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-my-Splunk-developed-app-everything-works-fine-on-Linux-but/m-p/211155#M41574</guid>
      <dc:creator>nnmiller</dc:creator>
      <dc:date>2015-11-02T17:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: In my Splunk developed app, everything works fine on Linux, but why is an extra line added to the beginning of all config files on Windows?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-my-Splunk-developed-app-everything-works-fine-on-Linux-but/m-p/211156#M41575</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;
I am a colleague of Mostafa.&lt;/P&gt;

&lt;P&gt;Many thanks for the response. Unfortunately none of your hints worked.&lt;BR /&gt;
When I am in Windows I can make the app working again, when I remove the additional line and set the encoding to ANSI or UTF-8 (no-BOM) - which is actually strange, because it should to the same like your suggestions in vim/emacs.&lt;/P&gt;

&lt;P&gt;We forgot to mention that we are using Splunk 6.2.6 and within our python scripts, we use the methods &lt;CODE&gt;readConf()&lt;/CODE&gt; and &lt;CODE&gt;writeConf()&lt;/CODE&gt;&lt;BR /&gt;
but without any parameters that specify encoding.&lt;BR /&gt;
The splunk website for developers is actually pretty confusing. At least I was not able to find out if both methods are deprecated or not, or if there is any  proper replacement (I assume there is one).&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 13:51:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-my-Splunk-developed-app-everything-works-fine-on-Linux-but/m-p/211156#M41575</guid>
      <dc:creator>whahn</dc:creator>
      <dc:date>2015-11-26T13:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: In my Splunk developed app, everything works fine on Linux, but why is an extra line added to the beginning of all config files on Windows?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-my-Splunk-developed-app-everything-works-fine-on-Linux-but/m-p/211157#M41576</link>
      <description>&lt;P&gt;Hi Whahn,&lt;/P&gt;

&lt;P&gt;Even we have run in to a same issue, where conf files are created with extra line in windows, can you please share the latest update or workaround you might have used to fix this if any.&lt;/P&gt;

&lt;P&gt;However for now as a workaround, if the blank files are created in local folder manually, it works fine(by updating the data in conf file without issues - i.e issue is only while creating a new file).&lt;/P&gt;

&lt;P&gt;if there is a fix or update , please share.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Naveen&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 03:33:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-my-Splunk-developed-app-everything-works-fine-on-Linux-but/m-p/211157#M41576</guid>
      <dc:creator>NaveenKalasam</dc:creator>
      <dc:date>2017-03-14T03:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: In my Splunk developed app, everything works fine on Linux, but why is an extra line added to the beginning of all config files on Windows?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/In-my-Splunk-developed-app-everything-works-fine-on-Linux-but/m-p/211158#M41577</link>
      <description>&lt;P&gt;Hi Mostafa/Whahn,&lt;/P&gt;

&lt;P&gt;Were you able resolve this issue. kindly share the details if so.&lt;/P&gt;

&lt;P&gt;Thansk&lt;BR /&gt;
Naveen&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 03:34:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/In-my-Splunk-developed-app-everything-works-fine-on-Linux-but/m-p/211158#M41577</guid>
      <dc:creator>NaveenKalasam</dc:creator>
      <dc:date>2017-03-14T03:34:48Z</dc:date>
    </item>
  </channel>
</rss>

