<?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 Re: How to split a fieldvalue at the very first line break? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333543#M61650</link>
    <description>&lt;P&gt;Unfortunately I'm not familiar with rex commands. Can you give me a hint how to adopt this?&lt;BR /&gt;
I tried  &lt;/P&gt;

&lt;P&gt;|  rex field=fieldA (?[^ ]*)\n&lt;/P&gt;

&lt;P&gt;But Splunk tells me&lt;BR /&gt;
&lt;STRONG&gt;Error in 'SearchParser': Missing a search command before '^'.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;PS: I don't know why this comment function rejects parts of my entered command after submitting it &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jul 2017 08:05:36 GMT</pubDate>
    <dc:creator>HeinzWaescher</dc:creator>
    <dc:date>2017-07-26T08:05:36Z</dc:date>
    <item>
      <title>How to split a fieldvalue at the very first line break?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333541#M61648</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I want to split up a fieldvalue into two parts at the very first linebreak (in total there is an unknown amount of linebreaks)&lt;/P&gt;

&lt;P&gt;Here is an example.&lt;/P&gt;

&lt;P&gt;Shown Fieldvalue:&lt;BR /&gt;
&lt;STRONG&gt;java.lang.IllegalStateException: Could not generated a new mission config for player 97a49f4e-e99e-4594-8284-80989333 and horde config 97a49f4e-e99e-4594-8284-80989333 on island 97a49f4e-e99e-4594-8284-80989333&lt;/STRONG&gt;&lt;BR /&gt;
at s.r.GeneratedConstructorAccessor309.newInstance(Unknown Source)&lt;BR /&gt;
at s.r.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)&lt;BR /&gt;
...&lt;/P&gt;

&lt;P&gt;Raw data:&lt;BR /&gt;
"stacktrace":"java.lang.IllegalStateException: Could not generated a new mission config for player 97a49f4e-e99e-4594-8284-80989333 and horde config 97a49f4e-e99e-4594-8284-80989333 on island 97a49f4e-e99e-4594-8284-80989333\n\tat s.r.GeneratedConstructorAccessor309.newInstance(Unknown Source)\n\tat s.r.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n\tat&lt;BR /&gt;
...&lt;/P&gt;

&lt;P&gt;I want to cut after the first linebreak and ignore all following linebreaks. So that in the end the bold is fieldA and the rest is fieldB&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 07:40:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333541#M61648</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2017-07-26T07:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a fieldvalue at the very first line break?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333542#M61649</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
did you tried something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;your_field&amp;gt;[^\n]*)\n
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;your_field&amp;gt;[^ ]*)\n
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 07:51:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333542#M61649</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-26T07:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a fieldvalue at the very first line break?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333543#M61650</link>
      <description>&lt;P&gt;Unfortunately I'm not familiar with rex commands. Can you give me a hint how to adopt this?&lt;BR /&gt;
I tried  &lt;/P&gt;

&lt;P&gt;|  rex field=fieldA (?[^ ]*)\n&lt;/P&gt;

&lt;P&gt;But Splunk tells me&lt;BR /&gt;
&lt;STRONG&gt;Error in 'SearchParser': Missing a search command before '^'.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;PS: I don't know why this comment function rejects parts of my entered command after submitting it &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 08:05:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333543#M61650</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2017-07-26T08:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a fieldvalue at the very first line break?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333544#M61651</link>
      <description>&lt;P&gt;if you use this regex in a field you can write&lt;BR /&gt;
(?[^ ]*)\n&lt;BR /&gt;
if instead you use it in a search, you must put regex in brackets, write&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your_search
| rex "(?&amp;lt;your_field&amp;gt;[^ ]*)\n"
| ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;try both the solutions ( &lt;CODE&gt;[^ ]&lt;/CODE&gt; and &lt;CODE&gt;[^\n]&lt;/CODE&gt;)&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 08:58:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333544#M61651</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-26T08:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a fieldvalue at the very first line break?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333545#M61652</link>
      <description>&lt;P&gt;thanks for the clarification. Both options don't change the fieldvalue&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 09:06:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333545#M61652</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2017-07-26T09:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a fieldvalue at the very first line break?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333546#M61653</link>
      <description>&lt;P&gt;could you share another example of your log?&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 09:18:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333546#M61653</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-26T09:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a fieldvalue at the very first line break?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333547#M61654</link>
      <description>&lt;P&gt;Here is an example.&lt;/P&gt;

&lt;P&gt;Shown Fieldvalue:&lt;BR /&gt;
&lt;STRONG&gt;java.lang.IllegalStateException: Could not generated a new mission config for player 97a49f4e-e99e-4594-8284-80989333 and horde config 97a49f4e-e99e-4594-8284-80989333 on island 97a49f4e-e99e-4594-8284-80989333&lt;/STRONG&gt;&lt;BR /&gt;
    &lt;EM&gt;at s.r.GeneratedConstructorAccessor309.newInstance(Unknown Source)&lt;BR /&gt;
    at s.r.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)&lt;/EM&gt;&lt;BR /&gt;
...&lt;/P&gt;

&lt;P&gt;Raw data:&lt;BR /&gt;
"stacktrace":"java.lang.IllegalStateException: Could not generated a new mission config for player 97a49f4e-e99e-4594-8284-80989333 and horde config 97a49f4e-e99e-4594-8284-80989333 on island 97a49f4e-e99e-4594-8284-80989333\n\tat s.r.GeneratedConstructorAccessor309.newInstance(Unknown Source)\n\tat s.r.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n\tat&lt;BR /&gt;
...&lt;/P&gt;

&lt;P&gt;I want to cut after the first linebreak, so that the bold is fieldA and the rest is fieldB&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 09:26:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333547#M61654</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2017-07-26T09:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a fieldvalue at the very first line break?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333548#M61655</link>
      <description>&lt;P&gt;try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;field1&amp;gt;[^\r\n]*)\n(?&amp;lt;field2&amp;gt;.*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you can test it at &lt;A href="https://regex101.com/r/10IbYY/1"&gt;https://regex101.com/r/10IbYY/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 09:34:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333548#M61655</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-26T09:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a fieldvalue at the very first line break?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333549#M61656</link>
      <description>&lt;P&gt;this seems to be a step in the right direction. the field is separated, but field2 only shows the part until the next linebreak appears. can we ignore all linebreaks afterwards?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 09:41:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333549#M61656</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2017-07-26T09:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a fieldvalue at the very first line break?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333550#M61657</link>
      <description>&lt;P&gt;strange in my regex101 test field2 takes all until the end...&lt;BR /&gt;
anyway try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?s)(?&amp;lt;field1&amp;gt;[^\r\n]*)\n(?&amp;lt;field2&amp;gt;.*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;see it at &lt;A href="https://regex101.com/r/10IbYY/2"&gt;https://regex101.com/r/10IbYY/2&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 10:52:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333550#M61657</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-26T10:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a fieldvalue at the very first line break?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333551#M61658</link>
      <description>&lt;P&gt;thanks, that looks very promising! I recognized some cases where it does not work. any idea why for this example here:&lt;/P&gt;

&lt;P&gt;java.net.SocketException: Unrecognized Windows Sockets error: 0: recv failed at java.net.SocketInputStream.socketRead0(SocketInputStream.java) at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) at &lt;/P&gt;

&lt;P&gt;In Splunk field1 is empty. field2 is:&lt;BR /&gt;
at java.net.SocketInputStream.socketRead0(SocketInputStream.java) at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) at &lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 12:23:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333551#M61658</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2017-07-26T12:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a fieldvalue at the very first line break?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333552#M61659</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "(?ms)^(?&amp;lt;part1&amp;gt;[^\r\n]+)[\r\n]+(?&amp;lt;part2&amp;gt;.*)$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Jul 2017 16:49:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333552#M61659</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-26T16:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a fieldvalue at the very first line break?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333553#M61660</link>
      <description>&lt;P&gt;this seems to work all cases &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; thanks&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 07:30:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333553#M61660</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2017-07-27T07:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a fieldvalue at the very first line break?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333554#M61661</link>
      <description>&lt;P&gt;I cannot see if there's a newline for each line.&lt;BR /&gt;
Putting this example in regex101, all the three lines are in field1, if I insert a newline after the first, all logs are correctly read (the first in field1 and the others in field2).&lt;BR /&gt;
Probably there's only one newline in these records.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 08:38:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-fieldvalue-at-the-very-first-line-break/m-p/333554#M61661</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-27T08:38:37Z</dc:date>
    </item>
  </channel>
</rss>

