<?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 can I extract breakable_text properly? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-breakable-text-properly/m-p/236494#M70244</link>
    <description>&lt;P&gt;You could try with the extract command at search time:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search here
| extract pairdelim="\n", kvdelim=":"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or (better approach probably) try adding the relevant stanzas in props and transforms to extract what you want:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Jul 2016 15:53:09 GMT</pubDate>
    <dc:creator>javiergn</dc:creator>
    <dc:date>2016-07-01T15:53:09Z</dc:date>
    <item>
      <title>How can I extract breakable_text properly?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-breakable-text-properly/m-p/236493#M70243</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;

&lt;P&gt;I have many logs in the following format as an example&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Timestamp: 6/27/2016 8:40:25 PM&lt;BR /&gt;
Message: Matcher: Record not matched for example record&lt;BR /&gt;
Category: Business&lt;BR /&gt;
Priority: 10&lt;BR /&gt;
EventId: 1&lt;BR /&gt;
Severity: Information&lt;BR /&gt;
Title:Information&lt;BR /&gt;
Machine: MachineName&lt;BR /&gt;
App Domain: Test.exe&lt;BR /&gt;
ProcessId: 5400&lt;BR /&gt;
Process Name: E:\Test\Test.exe&lt;BR /&gt;
Thread Name: &lt;BR /&gt;
Win32 ThreadId:2600&lt;BR /&gt;
Extended Properties: &lt;/P&gt;

&lt;P&gt;I want to be able to grab all the information after the field name, for example I want a field called Machine, and have the data be 'MachineName.' By using a \n as a delimiter I can split all of the lines up, however I do not want the field name itself. Any advice on what regex to create to do this? Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 15:16:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-breakable-text-properly/m-p/236493#M70243</guid>
      <dc:creator>ew09</dc:creator>
      <dc:date>2016-07-01T15:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract breakable_text properly?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-breakable-text-properly/m-p/236494#M70244</link>
      <description>&lt;P&gt;You could try with the extract command at search time:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search here
| extract pairdelim="\n", kvdelim=":"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or (better approach probably) try adding the relevant stanzas in props and transforms to extract what you want:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 15:53:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-breakable-text-properly/m-p/236494#M70244</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-07-01T15:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract breakable_text properly?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-breakable-text-properly/m-p/236495#M70245</link>
      <description>&lt;P&gt;Thanks for the input. The only issue I run into is on the Message line. There are usually at least two colons, is there a way I can take everything after the Message field even if that character is a colon? Basically, I want to take everything after a colon until it hits a newline&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 16:15:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-breakable-text-properly/m-p/236495#M70245</guid>
      <dc:creator>ew09</dc:creator>
      <dc:date>2016-07-01T16:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract breakable_text properly?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-breakable-text-properly/m-p/236496#M70246</link>
      <description>&lt;P&gt;Another approach using a little bit of regex to get exactly what you need.&lt;BR /&gt;
You can obviously ignore the first lines that I used to replicate your use case:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count | fields - count
| eval _raw = "
Timestamp: 6/27/2016 8:40:25 PM
Message: Matcher: Record not matched for example record
Category: Business
Priority: 10
EventId: 1
Severity: Information
Title:Information
Machine: MachineName
App Domain: Test.exe
ProcessId: 5400
Process Name: E:\Test\Test.exe
Thread Name: 
Win32 ThreadId:2600
Extended Properties:
"
| rex field=_raw max_match=0 "(?msi)^(?&amp;lt;keyvalue&amp;gt;[^:]+:\s?([^\n]+)?)$"
| mvexpand keyvalue
| rex field=keyvalue "(?i)^(?&amp;lt;key&amp;gt;[^:]+):\s?((?&amp;lt;value&amp;gt;[^\n]+)$)?"
| fillnull value value="NULL"
| fields - keyvalue
| eval {key}=value
| fields - key, value
| stats first(*) as * by _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Output: see picture&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1533i23A5D5692A082456/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 16:49:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-breakable-text-properly/m-p/236496#M70246</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-07-01T16:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract breakable_text properly?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-breakable-text-properly/m-p/236497#M70247</link>
      <description>&lt;P&gt;see my other answer below.&lt;BR /&gt;
Hope it helps&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 16:50:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-breakable-text-properly/m-p/236497#M70247</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-07-01T16:50:08Z</dc:date>
    </item>
  </channel>
</rss>

