<?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: Field extraction regex issues in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-regex-issues/m-p/625144#M217310</link>
    <description>&lt;P&gt;Hi Giuseppe,&lt;/P&gt;&lt;P&gt;Looks like that fails. e.g. zero counts for index = XXXXXXX | stats count by Session.&lt;/P&gt;&lt;P&gt;I did forget to put a line in the source so likely that is the issue.&lt;/P&gt;&lt;P&gt;--TIME: 2022-12-23 07:17:09.399&lt;BR /&gt;SESSION: Session closed&lt;BR /&gt;Client address: 123.CCCCCCC&lt;BR /&gt;Client name: CC222C22[123.123.12.123]&lt;BR /&gt;User interface: CCCCCCC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Dec 2022 23:25:22 GMT</pubDate>
    <dc:creator>svarendorff</dc:creator>
    <dc:date>2022-12-22T23:25:22Z</dc:date>
    <item>
      <title>Field extraction regex issues</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-regex-issues/m-p/625047#M217281</link>
      <description>&lt;P&gt;Having some issue with extraction.&lt;/P&gt;&lt;P&gt;source:&lt;/P&gt;&lt;P&gt;SESSION: Session closed&lt;BR /&gt;Client address: 123.CCCCCCC&lt;BR /&gt;Client name: CC222C22[123.123.12.123]&lt;BR /&gt;User interface: CCCCCCC&lt;/P&gt;&lt;P&gt;&lt;A href="https://regex101.com/" target="_blank" rel="noopener"&gt;https://regex101.com/&lt;/A&gt;&amp;nbsp;shows that&amp;nbsp;^[^\.\n]*SESSION:(?P&amp;lt;Session&amp;gt;.*) will work.&lt;/P&gt;&lt;P&gt;Splunk when trying returns almost the complete message. Almost like it does not see the new line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically I want from SESSION: to the end of line and if Splunk cannot do that to Client.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 07:30:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-regex-issues/m-p/625047#M217281</guid>
      <dc:creator>svarendorff</dc:creator>
      <dc:date>2022-12-22T07:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction regex issues</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-regex-issues/m-p/625050#M217282</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/32097"&gt;@svarendorff&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try this regex :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(?ms)^[^\.\n]*SESSION:(?P&amp;lt;Session&amp;gt;.*)\nClient\s+address&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 07:38:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-regex-issues/m-p/625050#M217282</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-12-22T07:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction regex issues</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-regex-issues/m-p/625144#M217310</link>
      <description>&lt;P&gt;Hi Giuseppe,&lt;/P&gt;&lt;P&gt;Looks like that fails. e.g. zero counts for index = XXXXXXX | stats count by Session.&lt;/P&gt;&lt;P&gt;I did forget to put a line in the source so likely that is the issue.&lt;/P&gt;&lt;P&gt;--TIME: 2022-12-23 07:17:09.399&lt;BR /&gt;SESSION: Session closed&lt;BR /&gt;Client address: 123.CCCCCCC&lt;BR /&gt;Client name: CC222C22[123.123.12.123]&lt;BR /&gt;User interface: CCCCCCC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 23:25:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-regex-issues/m-p/625144#M217310</guid>
      <dc:creator>svarendorff</dc:creator>
      <dc:date>2022-12-22T23:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction regex issues</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-regex-issues/m-p/625149#M217314</link>
      <description>&lt;P&gt;Why struggle with \n when this will do? (New line is one character in SPL's PCRE that is not fully PCRE conformant.)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "SESSION: (?&amp;lt;Session&amp;gt;.+)"&lt;/LI-CODE&gt;&lt;P&gt;This is my emulation&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval _raw = "--TIME: 2022-12-23 07:17:09.399
SESSION: Session closed
Client address: 123.CCCCCCC
Client name: CC222C22[123.123.12.123]
User interface: CCCCCCC"
``` data emulation above ```&lt;/LI-CODE&gt;&lt;P&gt;The result is&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;Session&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;_raw&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;&lt;SPAN&gt;Session closed&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;&lt;SPAN&gt;--TIME: 2022-12-23 07:17:09.399 SESSION: Session closed Client address: 123.CCCCCCC Client name: CC222C22[123.123.12.123] User interface: CCCCCCC&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 23 Dec 2022 01:54:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-regex-issues/m-p/625149#M217314</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-12-23T01:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction regex issues</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-regex-issues/m-p/625152#M217316</link>
      <description>&lt;P&gt;Thank you Yuanliu. New to this type of items in Splunk so very happy for any advice and assistance.&lt;/P&gt;&lt;P&gt;So&lt;/P&gt;&lt;PRE&gt;| rex "SESSION: (?&amp;lt;Session&amp;gt;.+)"&lt;/PRE&gt;&lt;P&gt;works in a search&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="svarendorff_0-1671762088672.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23125iE961BE5E0AC95CEE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="svarendorff_0-1671762088672.png" alt="svarendorff_0-1671762088672.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However, as an extraction I get nothing. Likely overlap with another similar that looks for Activity. May be best for these to do just in the search hard coded as the events have so many different items.&lt;/P&gt;&lt;P&gt;E,g, the second line has Session, Activity, User, etc that I would like to extract.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 02:28:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-regex-issues/m-p/625152#M217316</guid>
      <dc:creator>svarendorff</dc:creator>
      <dc:date>2022-12-23T02:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction regex issues</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-regex-issues/m-p/625161#M217317</link>
      <description>&lt;P&gt;In SPL, newline is often represented by \s (as opposed to \n). &amp;nbsp;I don't know the exact rule to be frank. &amp;nbsp;So, you can try something like this in field extraction&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"TIME: \d{4}(-\d\d){2} \d\d:\d\d:\d\d\.\d{3}\sSESSION: (?&amp;lt;Session&amp;gt;.+)\sClient address:"&lt;/LI-CODE&gt;&lt;P&gt;It works with rex.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 06:48:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-regex-issues/m-p/625161#M217317</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-12-23T06:48:11Z</dc:date>
    </item>
  </channel>
</rss>

