<?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 event lines into multiple fields using regex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-event-lines-into-multiple-fields-using-regex/m-p/264047#M79252</link>
    <description>&lt;P&gt;Based on your sample search, you've multiline event. I would suggest to configure line breaking to split those multiple events as separate events as I can see they all have timestamp and good candidates for line breaking. It will also reduce load on indexers.&lt;/P&gt;

&lt;P&gt;Meanwhile, Try this (check the line 1 and update according your current search)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="myindex" sourcetype="mysourcetype" | rex "(?m)^(?&amp;lt;line&amp;gt;\V+)$" max_match=10000 | table line | mvexpand line
  | rex field=line "^(?&amp;lt;Eventtime&amp;gt;(\S+\s+){6})(?&amp;lt;ServerType&amp;gt;\S+)\s+(?&amp;lt;ServerName&amp;gt;\S+)\s+(?&amp;lt;Status&amp;gt;\S+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If above doesn't work try this as well&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="myindex" sourcetype="mysourcetype" | rex "(?m)^(?&amp;lt;line&amp;gt;\V+)$" max_match=10000 | table line | mvexpand line | rex mode=sed field=line "s/^\s+(.+)/\1/"   | rex field=line "^(?&amp;lt;Eventtime&amp;gt;(\S+\s+){6})(?&amp;lt;ServerType&amp;gt;\S+)\s+(?&amp;lt;ServerName&amp;gt;\S+)\s+(?&amp;lt;Status&amp;gt;\S+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Mar 2016 22:45:27 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-03-29T22:45:27Z</dc:date>
    <item>
      <title>How to split event lines into multiple fields using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-event-lines-into-multiple-fields-using-regex/m-p/264042#M79247</link>
      <description>&lt;P&gt;HI, &lt;/P&gt;

&lt;P&gt;I am trying to write a regex to split these event lines into multiple fields.&lt;BR /&gt;
Can some one please help me how to achieve this for these events mentioned below?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Tue Mar 29 15:20:16 EDT 2016 NODE MDMServiceDmgrNode on   - Deployment manager
Tue Mar 29 15:20:16 EDT 2016 NODE MDMServiceNode01 on  
Tue Mar 29 15:20:16 EDT 2016 NODE MDMServiceNode02 on 

Tue Mar 29 15:20:16 EDT 2016    DEPLOYMENT_MANAGER dmgr            RUNNING
Tue Mar 29 15:20:16 EDT 2016    APPLICATION_SERVER MDMServiceAppServer01 RUNNING
Tue Mar 29 15:20:16 EDT 2016    NODE_AGENT         nodeagent       RUNNING
Tue Mar 29 15:20:16 EDT 2016    APPLICATION_SERVER MDMServiceAppServer02 RUNNING
Tue Mar 29 15:20:16 EDT 2016    NODE_AGENT         nodeagent       RUNNING
Tue Mar 29 15:20:16 EDT 2016    WEB_SERVER         MDMServiceHTTPServer01 RUNNING
Tue Mar 29 15:20:16 EDT 2016    WEB_SERVER         MDMServiceHTTPServer02 RUNNING
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks, Much Appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 19:25:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-event-lines-into-multiple-fields-using-regex/m-p/264042#M79247</guid>
      <dc:creator>vamseepotluri</dc:creator>
      <dc:date>2016-03-29T19:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to split event lines into multiple fields using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-event-lines-into-multiple-fields-using-regex/m-p/264043#M79248</link>
      <description>&lt;P&gt;What are the fields?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 19:57:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-event-lines-into-multiple-fields-using-regex/m-p/264043#M79248</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-03-29T19:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to split event lines into multiple fields using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-event-lines-into-multiple-fields-using-regex/m-p/264044#M79249</link>
      <description>&lt;P&gt;Fields  should be something like this. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Eventtime                                           ServerType                               ServerName    Status&lt;/STRONG&gt;&lt;BR /&gt;
 Tue Mar 29 15:20:16 EDT 2016     DEPLOYMENT_MANAGER          dmgr                  RUNNING&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 20:51:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-event-lines-into-multiple-fields-using-regex/m-p/264044#M79249</guid>
      <dc:creator>vamseepotluri</dc:creator>
      <dc:date>2016-03-29T20:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to split event lines into multiple fields using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-event-lines-into-multiple-fields-using-regex/m-p/264045#M79250</link>
      <description>&lt;P&gt;You want to post what have you been trying, and explain what particular expectation is not met by your method.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 20:55:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-event-lines-into-multiple-fields-using-regex/m-p/264045#M79250</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2016-03-29T20:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to split event lines into multiple fields using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-event-lines-into-multiple-fields-using-regex/m-p/264046#M79251</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index="myindex" sourcetype="mysourcetype" | rex "(?m)^(?\V+)$" max_match=10000 | table line | mvexpand line | rex field=line "^(?%w\s%b\s%d\s%H:%M:%S\s%Z\s%Y\d+)\s+(?[a-zA-Z]\d+)\s+(?[a-z0-9#]\d+)\s+(?[a-zA-Z]\d+)$" | table eventtime, SERVERTYPE, SERVERNAME, STATUS
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Mar 2016 21:00:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-event-lines-into-multiple-fields-using-regex/m-p/264046#M79251</guid>
      <dc:creator>vamseepotluri</dc:creator>
      <dc:date>2016-03-29T21:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to split event lines into multiple fields using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-event-lines-into-multiple-fields-using-regex/m-p/264047#M79252</link>
      <description>&lt;P&gt;Based on your sample search, you've multiline event. I would suggest to configure line breaking to split those multiple events as separate events as I can see they all have timestamp and good candidates for line breaking. It will also reduce load on indexers.&lt;/P&gt;

&lt;P&gt;Meanwhile, Try this (check the line 1 and update according your current search)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="myindex" sourcetype="mysourcetype" | rex "(?m)^(?&amp;lt;line&amp;gt;\V+)$" max_match=10000 | table line | mvexpand line
  | rex field=line "^(?&amp;lt;Eventtime&amp;gt;(\S+\s+){6})(?&amp;lt;ServerType&amp;gt;\S+)\s+(?&amp;lt;ServerName&amp;gt;\S+)\s+(?&amp;lt;Status&amp;gt;\S+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If above doesn't work try this as well&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="myindex" sourcetype="mysourcetype" | rex "(?m)^(?&amp;lt;line&amp;gt;\V+)$" max_match=10000 | table line | mvexpand line | rex mode=sed field=line "s/^\s+(.+)/\1/"   | rex field=line "^(?&amp;lt;Eventtime&amp;gt;(\S+\s+){6})(?&amp;lt;ServerType&amp;gt;\S+)\s+(?&amp;lt;ServerName&amp;gt;\S+)\s+(?&amp;lt;Status&amp;gt;\S+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Mar 2016 22:45:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-event-lines-into-multiple-fields-using-regex/m-p/264047#M79252</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-03-29T22:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to split event lines into multiple fields using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-event-lines-into-multiple-fields-using-regex/m-p/264048#M79253</link>
      <description>&lt;P&gt;What is the intended purpose of the first rex command?&lt;BR /&gt;
The second rex command doesn't extract any fields.  Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=line "(?&amp;lt;Eventtime&amp;gt;\w+\s\w+\s\d+\s\d+:\d+:\d+\s\w+\s\d+)\s+(?&amp;lt;ServerType&amp;gt;[\w_]+)\s+(?&amp;lt;ServerName&amp;gt;\w+)\s+(?&amp;lt;Status&amp;gt;\w+)" | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Mar 2016 22:47:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-event-lines-into-multiple-fields-using-regex/m-p/264048#M79253</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-03-29T22:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to split event lines into multiple fields using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-event-lines-into-multiple-fields-using-regex/m-p/264049#M79254</link>
      <description>&lt;P&gt;Agree that multiline events are your enemy, especially when every line has a valid timestamp.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 22:54:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-event-lines-into-multiple-fields-using-regex/m-p/264049#M79254</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2016-03-29T22:54:00Z</dc:date>
    </item>
  </channel>
</rss>

