<?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 Conf files — splitting long lines in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Conf-files-splitting-long-lines/m-p/81897#M16911</link>
    <description>&lt;P&gt;I am trying to split some really long lines we have put in our &lt;CODE&gt;.conf&lt;/CODE&gt; files using the traditional Unix way of escaping the linefeed, and get weird errors.  If I do&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[RenameGeneral]
definition = rename \
           User_Name -&amp;gt; User,\
           Group_Name -&amp;gt; Group
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get a message that says&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Error in 'rename' command: Usage: rename [old_name AS/TO/-&amp;gt; new_name]+&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;However,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[RenameGeneral]
definition = rename User_Name -&amp;gt; User, Group_Name -&amp;gt; Group
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;works fine.&lt;/P&gt;

&lt;P&gt;This is a rather minimal example, our long lines are easily 1000+ characters long.&lt;/P&gt;

&lt;P&gt;What is the proper splunkey way to split very long lines in &lt;CODE&gt;.conf&lt;/CODE&gt; files, if there is any?&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Edit&lt;/STRONG&gt;: strangely, these two macros behave differently:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[newline_one]
definition = rename _time AS g \
           | eval ones=1

[newline_two]
definition = eval ones=1 \
           | rename _time AS g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first one gives the error I have quoted above while the second one does what is expected.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 13:39:07 GMT</pubDate>
    <dc:creator>MikhailArefiev</dc:creator>
    <dc:date>2020-09-28T13:39:07Z</dc:date>
    <item>
      <title>Conf files — splitting long lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Conf-files-splitting-long-lines/m-p/81897#M16911</link>
      <description>&lt;P&gt;I am trying to split some really long lines we have put in our &lt;CODE&gt;.conf&lt;/CODE&gt; files using the traditional Unix way of escaping the linefeed, and get weird errors.  If I do&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[RenameGeneral]
definition = rename \
           User_Name -&amp;gt; User,\
           Group_Name -&amp;gt; Group
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get a message that says&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Error in 'rename' command: Usage: rename [old_name AS/TO/-&amp;gt; new_name]+&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;However,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[RenameGeneral]
definition = rename User_Name -&amp;gt; User, Group_Name -&amp;gt; Group
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;works fine.&lt;/P&gt;

&lt;P&gt;This is a rather minimal example, our long lines are easily 1000+ characters long.&lt;/P&gt;

&lt;P&gt;What is the proper splunkey way to split very long lines in &lt;CODE&gt;.conf&lt;/CODE&gt; files, if there is any?&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Edit&lt;/STRONG&gt;: strangely, these two macros behave differently:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[newline_one]
definition = rename _time AS g \
           | eval ones=1

[newline_two]
definition = eval ones=1 \
           | rename _time AS g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first one gives the error I have quoted above while the second one does what is expected.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:39:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Conf-files-splitting-long-lines/m-p/81897#M16911</guid>
      <dc:creator>MikhailArefiev</dc:creator>
      <dc:date>2020-09-28T13:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Conf files — splitting long lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Conf-files-splitting-long-lines/m-p/81898#M16912</link>
      <description>&lt;P&gt;i hope you can just use enter and tab&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2013 19:50:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Conf-files-splitting-long-lines/m-p/81898#M16912</guid>
      <dc:creator>eashwar</dc:creator>
      <dc:date>2013-04-02T19:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Conf files — splitting long lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Conf-files-splitting-long-lines/m-p/81899#M16913</link>
      <description>&lt;P&gt;@eashwar I have just tried newline and tab (0x0a 0x09), it says &lt;CODE&gt;Possible typo in stanza [newline_three] in /opt/splunk/etc/system/local/macros.conf, line 25:  | eval ones = 1&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2013 08:06:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Conf-files-splitting-long-lines/m-p/81899#M16913</guid>
      <dc:creator>MikhailArefiev</dc:creator>
      <dc:date>2013-04-03T08:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Conf files — splitting long lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Conf-files-splitting-long-lines/m-p/81900#M16914</link>
      <description>&lt;P&gt;I don't think you can split expressions over multiple lines in Splunk's config files like this at all.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2013 11:09:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Conf-files-splitting-long-lines/m-p/81900#M16914</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-04-03T11:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Conf files — splitting long lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Conf-files-splitting-long-lines/m-p/81901#M16915</link>
      <description>&lt;P&gt;@Ayn I beg to differ as I have successfully split very long expressions in the same manner as the second expression in the newline example in the edit.  The trick is to have &lt;CODE&gt;rename&lt;/CODE&gt; come last, and do no linebreaks there (including linebreaks in macros involving &lt;CODE&gt;rename&lt;/CODE&gt;).&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2013 13:19:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Conf-files-splitting-long-lines/m-p/81901#M16915</guid>
      <dc:creator>MikhailArefiev</dc:creator>
      <dc:date>2013-04-03T13:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: Conf files — splitting long lines</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Conf-files-splitting-long-lines/m-p/81902#M16916</link>
      <description>&lt;P&gt;I've successfully tested this in &lt;CODE&gt;inputs.conf&lt;/CODE&gt; for polling SNMP metrics with the SNMP modular input. I used 4 spaces to indent, rather than a tab character.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[snmp://blah_blah_polling]
...
snmp_mode = attributes
object_names = &amp;lt;really_long_oid_1&amp;gt;, \
    &amp;lt;really_long_oid_2&amp;gt;, \
    &amp;lt;really_long_oid_3&amp;gt;, \
    ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I haven't tested it, but I suspect this might work for &lt;CODE&gt;rename&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[newline_three]
definition = rename _time AS g | \
    eval ones=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is identical to &lt;CODE&gt;[newline_one]&lt;/CODE&gt; except that the pipe character is before the line break instead of after.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Nov 2014 04:08:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Conf-files-splitting-long-lines/m-p/81902#M16916</guid>
      <dc:creator>steven_swor</dc:creator>
      <dc:date>2014-11-20T04:08:38Z</dc:date>
    </item>
  </channel>
</rss>

