Splunk Search

How to extract a multiple line content as a field ?

raj_mpl
Path Finder

Hi ,
I need to extract multiple lines of raw log into a message field
example raw log:

timestamp : The decision about what to put into your paragraphs begins with the germination of a seed of ideas; this “germination process” is better known as brainstorming. There are many techniques for brainstorming; whichever one you choose, this stage of paragraph development cannot be skipped. Building paragraphs can be like building a skyscraper: there must be a well-planned foundation that supports what you are building. Any cracks, inconsistencies, or other corruptions of the foundation can cause your whole paper to crumble.
So, let’s suppose that you have done some brainstorming to develop your thesis. What else should you keep in mind as you begin to create paragraphs? Every paragraph in a paper should be:
Unified: All of the sentences in a single paragraph should be related to a single controlling idea (often expressed in the topic sentence of the paragraph).
Clearly related to the thesis: The sentences should all refer to the central idea, or thesis, of the paper (Rosen and Behrens 119).

Coherent: The sentences should be arranged in a logical manner and should follow a definite plan for development (Rosen and Behrens 119).

Now I want to extract the bold content from raw log . How to do this in Search Head ?
Thank you 🙂

Tags (1)
0 Karma

p_gurav
Champion

Hi raj_mpl,

This may help:

<your search> | rex "(?ms)^Unified: (?P<para>.+)Coherent: "
0 Karma

raj_mpl
Path Finder

Thanks @p_gurav for your reply on this , Yes it worked but what will be the regular expression if my event is like below

timestamp : The decision about what to put into your paragraphs begins with the germination of a seed of ideas; this “germination process” is better known as brainstorming. There are many techniques for brainstorming; whichever one you choose, this stage of paragraph development cannot be skipped. Building paragraphs can be like building a skyscraper: there must be a well-planned foundation that supports what you are building. Any cracks, inconsistencies, or other corruptions of the foundation can cause your whole paper to crumble.
So, let’s suppose that you have done some brainstorming to develop your thesis. What else should you keep in mind as you begin to create paragraphs? Every paragraph in a paper should be:
Unified: All of the sentences in a single paragraph should be related to a single controlling idea (often expressed in the topic sentence of the paragraph).
Clearly related to the thesis: The sentences should all refer to the central idea, or thesis, of the paper (Rosen and Behrens 119).
Coherent: The sentences should be arranged in a logical manner and should follow a definite plan for development (Rosen and Behrens 119).
Coherent: The sentences should be arranged in a logical manner and should follow or development (Rosen and Behrens 119).
Coherent: The sentences should be arranged in a follow a Coherent definite plan for development (Rosen and Behrens 119).

0 Karma

raj_mpl
Path Finder

I mean to fetch up to the first occurance of word "coherent" ,in case of multiple words(coherent) present in my event

0 Karma

raj_mpl
Path Finder

| rex "(?ms)^Unified: (?P.+?)Coherent: "

The above regex will work , (by adding ?) Thank you

0 Karma
Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...