<?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 How do I extract these 2 fields from my sample multiline event? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-these-2-fields-from-my-sample-multiline-event/m-p/204647#M59481</link>
    <description>&lt;P&gt;Hi Guys,&lt;/P&gt;

&lt;P&gt;I would like to be able to extract fields from the sample log below. In bold I have highlighted IP address and user ID that are listed, and with normal field extraction, Splunk will only take  the first value and ignore the rest. I have tried other suggestions (using regex) from similar threads, but wasn't able to extract. &lt;/P&gt;

&lt;P&gt;Jan 03 12:51:29 10.133.xxx.xxx Feb 16 12:35:49 host01 guard_sender[7071]: #015#012#015#012Alert Name: PruAlert_03.#015#012Alert Description: CA: Suspicious Database Activity, App User, UPDATE on Customer Master.#015#012#015#012Alert Classification: APPNAME #015#012Category: APPNAME #015#012Severity: LOW#015#012Query period: 3/1/15 - 3/1/15 #015#012#012#012Alert Details#012Timestamp             Client IP     DB User Name App User Name Total Records Affected SQL Verb Object Name #0122015-01-16 12:34:54.0 &lt;STRONG&gt;10.133.55.121&lt;/STRONG&gt; &lt;STRONG&gt;USERXYZ1&lt;/STRONG&gt;                   10                     UPDATE   cdb_address #0122015-01-16 12:33:53.0 &lt;STRONG&gt;10.133.55.122&lt;/STRONG&gt; &lt;STRONG&gt;USERXYZ2&lt;/STRONG&gt;                   10                     UPDATE   cdb_address #0122015-01-16 12:32:54.0 &lt;STRONG&gt;10.133.55.131&lt;/STRONG&gt; &lt;STRONG&gt;USERXYZ2&lt;/STRONG&gt;                   10                     UPDATE   cdb_address #0122015-01-16 12:32:51.0 &lt;STRONG&gt;10.133.55.132&lt;/STRONG&gt; &lt;STRONG&gt;USERXYZ1&lt;/STRONG&gt;                   10                     UPDATE   cdb_address &lt;/P&gt;

&lt;P&gt;The above log varies from event to event. Some contain one value while some contains ten values (IP and username). The same log when put in notepad and adjusted will be like a table, but in the results its shown as above.&lt;/P&gt;

&lt;P&gt;Timestamp             Client IP     DB User Name App User Name Total Records Affected SQL Verb Object Name &lt;/P&gt;

&lt;H1&gt;0122015-01-16 12:34:54.0 10.133.55.121 USERXYZ1                   10                     UPDATE   cdb_address&lt;/H1&gt;

&lt;H1&gt;0122015-01-16 12:33:53.0 10.133.55.122 USERXYZ2                   10                     UPDATE   cdb_address&lt;/H1&gt;

&lt;H1&gt;0122015-01-16 12:32:54.0 10.133.55.131 USERXYZ2                   10                     UPDATE   cdb_address&lt;/H1&gt;

&lt;H1&gt;0122015-01-16 12:32:51.0 10.133.55.132 USERXYZ1                   10                     UPDATE   cdb_address&lt;/H1&gt;

&lt;P&gt;i would like to extract Username and IP_add, either in-search regex or &lt;BR /&gt;
any suggestions? &lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 08:48:55 GMT</pubDate>
    <dc:creator>shaker_ali</dc:creator>
    <dc:date>2020-09-29T08:48:55Z</dc:date>
    <item>
      <title>How do I extract these 2 fields from my sample multiline event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-these-2-fields-from-my-sample-multiline-event/m-p/204647#M59481</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;

&lt;P&gt;I would like to be able to extract fields from the sample log below. In bold I have highlighted IP address and user ID that are listed, and with normal field extraction, Splunk will only take  the first value and ignore the rest. I have tried other suggestions (using regex) from similar threads, but wasn't able to extract. &lt;/P&gt;

&lt;P&gt;Jan 03 12:51:29 10.133.xxx.xxx Feb 16 12:35:49 host01 guard_sender[7071]: #015#012#015#012Alert Name: PruAlert_03.#015#012Alert Description: CA: Suspicious Database Activity, App User, UPDATE on Customer Master.#015#012#015#012Alert Classification: APPNAME #015#012Category: APPNAME #015#012Severity: LOW#015#012Query period: 3/1/15 - 3/1/15 #015#012#012#012Alert Details#012Timestamp             Client IP     DB User Name App User Name Total Records Affected SQL Verb Object Name #0122015-01-16 12:34:54.0 &lt;STRONG&gt;10.133.55.121&lt;/STRONG&gt; &lt;STRONG&gt;USERXYZ1&lt;/STRONG&gt;                   10                     UPDATE   cdb_address #0122015-01-16 12:33:53.0 &lt;STRONG&gt;10.133.55.122&lt;/STRONG&gt; &lt;STRONG&gt;USERXYZ2&lt;/STRONG&gt;                   10                     UPDATE   cdb_address #0122015-01-16 12:32:54.0 &lt;STRONG&gt;10.133.55.131&lt;/STRONG&gt; &lt;STRONG&gt;USERXYZ2&lt;/STRONG&gt;                   10                     UPDATE   cdb_address #0122015-01-16 12:32:51.0 &lt;STRONG&gt;10.133.55.132&lt;/STRONG&gt; &lt;STRONG&gt;USERXYZ1&lt;/STRONG&gt;                   10                     UPDATE   cdb_address &lt;/P&gt;

&lt;P&gt;The above log varies from event to event. Some contain one value while some contains ten values (IP and username). The same log when put in notepad and adjusted will be like a table, but in the results its shown as above.&lt;/P&gt;

&lt;P&gt;Timestamp             Client IP     DB User Name App User Name Total Records Affected SQL Verb Object Name &lt;/P&gt;

&lt;H1&gt;0122015-01-16 12:34:54.0 10.133.55.121 USERXYZ1                   10                     UPDATE   cdb_address&lt;/H1&gt;

&lt;H1&gt;0122015-01-16 12:33:53.0 10.133.55.122 USERXYZ2                   10                     UPDATE   cdb_address&lt;/H1&gt;

&lt;H1&gt;0122015-01-16 12:32:54.0 10.133.55.131 USERXYZ2                   10                     UPDATE   cdb_address&lt;/H1&gt;

&lt;H1&gt;0122015-01-16 12:32:51.0 10.133.55.132 USERXYZ1                   10                     UPDATE   cdb_address&lt;/H1&gt;

&lt;P&gt;i would like to extract Username and IP_add, either in-search regex or &lt;BR /&gt;
any suggestions? &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:48:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-these-2-fields-from-my-sample-multiline-event/m-p/204647#M59481</guid>
      <dc:creator>shaker_ali</dc:creator>
      <dc:date>2020-09-29T08:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract these 2 fields from my sample multiline event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-these-2-fields-from-my-sample-multiline-event/m-p/204648#M59482</link>
      <description>&lt;P&gt;First you should use LINE_BREAKER just to split the one line log to events.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2016 16:08:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-these-2-fields-from-my-sample-multiline-event/m-p/204648#M59482</guid>
      <dc:creator>jmallorquin</dc:creator>
      <dc:date>2016-02-16T16:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract these 2 fields from my sample multiline event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-these-2-fields-from-my-sample-multiline-event/m-p/204649#M59483</link>
      <description>&lt;P&gt;Try something like this&lt;BR /&gt;
For search (inline)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex max_match=0 "#\d+-\d+-\d+\s+\d+:\d+:\d+\.\d+\s+(?&amp;lt;Client_IP&amp;gt;\d+\.\d+\.\d+\.\d+)\s+(?&amp;lt;DB_User_Name&amp;gt;\S+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will create a multivalued field for Client_IP and DB_User_Name.&lt;/P&gt;

&lt;P&gt;Saved same in conf files. (On Search Head)&lt;/P&gt;

&lt;P&gt;props.conf &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yourSourceType]
...other configurations..
REPORT-fields = extract_ip_user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[extract_ip_user]
REGEX = #\d+-\d+-\d+\s+\d+:\d+:\d+\.\d+\s+(?&amp;lt;Client_IP&amp;gt;\d+\.\d+\.\d+\.\d+)\s+(?&amp;lt;DB_User_Name&amp;gt;\S+)
MV_ADD = true
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:49:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-these-2-fields-from-my-sample-multiline-event/m-p/204649#M59483</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T08:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract these 2 fields from my sample multiline event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-these-2-fields-from-my-sample-multiline-event/m-p/204650#M59484</link>
      <description>&lt;P&gt;Thank you. This works! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 07:43:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-these-2-fields-from-my-sample-multiline-event/m-p/204650#M59484</guid>
      <dc:creator>shaker_ali</dc:creator>
      <dc:date>2016-02-17T07:43:25Z</dc:date>
    </item>
  </channel>
</rss>

