<?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 capture multiple lines using rex command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-capture-multiple-lines-using-rex-command/m-p/308980#M160244</link>
    <description>&lt;P&gt;Thanks again,! but for time being, is there anyway to build regex for same?&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jul 2017 02:22:02 GMT</pubDate>
    <dc:creator>sumagarw</dc:creator>
    <dc:date>2017-07-13T02:22:02Z</dc:date>
    <item>
      <title>How to capture multiple lines using rex command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-capture-multiple-lines-using-rex-command/m-p/308975#M160239</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I am having difficulties capturing Multiple lines of logs from splunk using rex command. &lt;/P&gt;

&lt;P&gt;03:25:17.296: SIPTR: Received [0,UDP] 543 bytes from 10.xx.7x.1xx:8080 &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;
REGISTER sip:10.xx.7x.1xx SIP/2.0&lt;BR /&gt;
Via: SIP/2.0/UDP 10.xx.7x.1xx;branch=hkhi8u09uj&lt;BR /&gt;
From: "Dummy" ;tag=78979uh&lt;BR /&gt;
CSeq: 68789 REGISTER&lt;BR /&gt;
Call-ID: &lt;A href="mailto:xxxxxx-7689-xxxx@10.xx.7x.1xx"&gt;xxxxxx-7689-xxxx@10.xx.7x.1xx&lt;/A&gt;&lt;BR /&gt;
Contact: ;methods="INVITE, ACK, BYE, CANCEL, OPTIONS, UPDATE, REFER"&lt;BR /&gt;
User-Agent: Polycom_r64786r9879r87&lt;BR /&gt;
Accept-Language: en&lt;BR /&gt;
Max-Forwards: 70&lt;BR /&gt;
Expires: 60&lt;/P&gt;

&lt;P&gt;I have to capture lines starting from "REGISTER sip:" till "User-Agent: ", is there any way to capture multiple lines in same rex file?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 04:38:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-capture-multiple-lines-using-rex-command/m-p/308975#M160239</guid>
      <dc:creator>sumagarw</dc:creator>
      <dc:date>2017-07-11T04:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture multiple lines using rex command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-capture-multiple-lines-using-rex-command/m-p/308976#M160240</link>
      <description>&lt;P&gt;You need to use the dotall modifier to tell splunk to match newlines with '.' &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "REGISTER sip:(?s)(?&amp;lt;new_field_name&amp;gt;.*)User-Agent"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Jul 2017 11:53:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-capture-multiple-lines-using-rex-command/m-p/308976#M160240</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2017-07-11T11:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture multiple lines using rex command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-capture-multiple-lines-using-rex-command/m-p/308977#M160241</link>
      <description>&lt;P&gt;Hi sumagarw,&lt;BR /&gt;
try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGISTER sip:(?&amp;lt;your_field&amp;gt;(.|\n)+)User-Agent:
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;test it at &lt;A href="https://regex101.com/r/TlOYUg/1"&gt;https://regex101.com/r/TlOYUg/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 11:58:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-capture-multiple-lines-using-rex-command/m-p/308977#M160241</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-11T11:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture multiple lines using rex command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-capture-multiple-lines-using-rex-command/m-p/308978#M160242</link>
      <description>&lt;P&gt;Thanks @jplumsdaine22 &lt;BR /&gt;
Looks like i am able to capture required lines. Can you also help me to capture "10.xx.7x.1xx SIP/2.0" , "Dummy",  and "Call-ID: " from captured data in a table format. &lt;/P&gt;

&lt;P&gt;Thing is that data keeps on repeating, now i have to capture specified info from captured line and get in table format.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 12:22:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-capture-multiple-lines-using-rex-command/m-p/308978#M160242</guid>
      <dc:creator>sumagarw</dc:creator>
      <dc:date>2017-07-11T12:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture multiple lines using rex command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-capture-multiple-lines-using-rex-command/m-p/308979#M160243</link>
      <description>&lt;P&gt;What you should do is create a field extraction for each field in the data. That will make your job a great deal easier! &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/ExtractfieldsinteractivelywithIFX"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/ExtractfieldsinteractivelywithIFX&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 12:43:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-capture-multiple-lines-using-rex-command/m-p/308979#M160243</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2017-07-11T12:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture multiple lines using rex command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-capture-multiple-lines-using-rex-command/m-p/308980#M160244</link>
      <description>&lt;P&gt;Thanks again,! but for time being, is there anyway to build regex for same?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 02:22:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-capture-multiple-lines-using-rex-command/m-p/308980#M160244</guid>
      <dc:creator>sumagarw</dc:creator>
      <dc:date>2017-07-13T02:22:02Z</dc:date>
    </item>
  </channel>
</rss>

