<?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: multiline regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/multiline-regex/m-p/66175#M16431</link>
    <description>&lt;P&gt;Did you look at other answers? This one seems to be relevant&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/38753/regex-for-multiline-events"&gt;http://answers.splunk.com/answers/38753/regex-for-multiline-events&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Sep 2013 04:16:59 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2013-09-18T04:16:59Z</dc:date>
    <item>
      <title>multiline regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiline-regex/m-p/66173#M16429</link>
      <description>&lt;P&gt;I have an unstructured log file that looks like the following. How would I go about creating key/value pairs for metrics like "Queue Additions Max Time" or "Data Insertions Avg Time" when part of the qualifier for the field name spans a different line than the metric name and value?&lt;BR /&gt;
thanks&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;17-09-2013 17:36:58,489 CDT INFO  [scheduler-2] [org.hyperic.hq.common.DiagnosticsLogger@105] [com.hyperic.hq.measurement.server.session.BatchAggregateDiagnostic@75a20d1c] Batch Aggregate DataInserter Diagnostics
Configuration:
    Workers:    10
    QueueSize:  500000
    BatchSize:  1000
Queue Additions:
    # calls:    1585
    Max time:   12 ms
    Avg time:   0 ms
Data Insertions:
    # calls:    966
    Max time:   640 ms
    Avg time:   27 ms
Queue size:
    # entries:  0
    Max size:   1403
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Sep 2013 22:55:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiline-regex/m-p/66173#M16429</guid>
      <dc:creator>briang67</dc:creator>
      <dc:date>2013-09-17T22:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: multiline regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiline-regex/m-p/66174#M16430</link>
      <description>&lt;P&gt;Have you tried a search | regex yet?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2013 01:51:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiline-regex/m-p/66174#M16430</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-09-18T01:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: multiline regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiline-regex/m-p/66175#M16431</link>
      <description>&lt;P&gt;Did you look at other answers? This one seems to be relevant&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/38753/regex-for-multiline-events"&gt;http://answers.splunk.com/answers/38753/regex-for-multiline-events&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2013 04:16:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiline-regex/m-p/66175#M16431</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-09-18T04:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: multiline regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiline-regex/m-p/66176#M16432</link>
      <description>&lt;P&gt;Assuming “Max time” and  “Ave time” are recognized as fields:&lt;BR /&gt;
You can use mvindex to identify which value you want.  For example, the following search will pull out  "Queue Additions Max Time" and "Data Insertions Avg Time":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search | eval Queue_Additions_Max_Time =mvindex(Max_time,0) | eval Queue_Additions_Avg_Time =mvindex(Ave_time,0) |  eval Data_Insertions_Max_Time =mvindex(Max_time,1) eval Data_Insertions_Avg_Time =mvindex(Ave_time,1) |table Queue_Additions_Max_Time, Queue_Additions_Avg_Time ,Data_Insertions_Max_Time, Data_Insertions_Avg_Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As you can see, the 0 pulls the first occurrence in a multivalue field, and 1 pulls the second occurrence.&lt;/P&gt;

&lt;P&gt;Let us know if “Max time” and  “Ave time” are not automatically recognized as fields because a rex function can be used to create the fields.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2013 13:45:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiline-regex/m-p/66176#M16432</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-09-18T13:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: multiline regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiline-regex/m-p/66177#M16433</link>
      <description>&lt;P&gt;This search is failing for me with an "Error in 'eval' command: The operator at 'eval Data_Insertions_Avg_Time =mvindex(avg_time,1)' is invalid." &lt;/P&gt;

&lt;P&gt;I believe this is because my regex that creates the max_time field is only matching against the first instance of max_time in the event. I think if I can fix that this query will work.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:48:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiline-regex/m-p/66177#M16433</guid>
      <dc:creator>briang67</dc:creator>
      <dc:date>2020-09-28T14:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: multiline regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiline-regex/m-p/66178#M16434</link>
      <description>&lt;P&gt;Can you post your regex?&lt;BR /&gt;&lt;BR /&gt;
A rex might be better.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2013 14:47:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiline-regex/m-p/66178#M16434</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-09-18T14:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: multiline regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiline-regex/m-p/66179#M16435</link>
      <description>&lt;P&gt;Unfortunately there is no automatic way to do this but you can use multiple extractions ordered appropriately. In props.conf you can do inline EXTRACTS-xxx that extract &lt;CODE&gt;configuration&lt;/CODE&gt;, &lt;CODE&gt;queue_additions&lt;/CODE&gt;, &lt;CODE&gt;data_insertions&lt;/CODE&gt; and &lt;CODE&gt;queue_size&lt;/CODE&gt; fields, then use REPORT-yyy scoped on each one with FIELDS names of your liking.  &lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2013 17:31:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiline-regex/m-p/66179#M16435</guid>
      <dc:creator>_d_</dc:creator>
      <dc:date>2013-09-19T17:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: multiline regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiline-regex/m-p/66180#M16436</link>
      <description>&lt;P&gt;I eventually got this to work using a complex regex that included newline chars.  This is probably not the most efficient/elegant way to handle this, but I was able to make it work.  Thanks to everyone who answered.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 21:14:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiline-regex/m-p/66180#M16436</guid>
      <dc:creator>briang67</dc:creator>
      <dc:date>2013-10-28T21:14:46Z</dc:date>
    </item>
  </channel>
</rss>

