<?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: Regex for multi-value field in which some values are listed and then aren't in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-multi-value-field-in-which-some-values-are-listed-and/m-p/221759#M65179</link>
    <description>&lt;P&gt;I've been struggling with the frustrating code tag markdown as I selected the code button, which adds the tickmarks to the beginning and end of the code, but the page still yells at me when I go to post it&lt;/P&gt;</description>
    <pubDate>Tue, 04 Oct 2016 15:47:13 GMT</pubDate>
    <dc:creator>jwalzerpitt</dc:creator>
    <dc:date>2016-10-04T15:47:13Z</dc:date>
    <item>
      <title>Regex for multi-value field in which some values are listed and then aren't</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-multi-value-field-in-which-some-values-are-listed-and/m-p/221755#M65175</link>
      <description>&lt;P&gt;I am trying to create a regex for a multivalue field (Message) in which some values are listed and sometimes aren't listed depending on the event. We are ingesting Shibboleth logs via _json format, and I am trying to extract three values from the Message field: URL, username, and src_ip (in bold in each event).&lt;/P&gt;

&lt;P&gt;There are three different events for Shibboleth.&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/161252-shib-events.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Is it possible to create a regex that would apply to all three events?&lt;/P&gt;

&lt;P&gt;I have one regex that covers the first event and extracts the three fields.&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/161253-shib-regex.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Thx&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:12:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-multi-value-field-in-which-some-values-are-listed-and/m-p/221755#M65175</guid>
      <dc:creator>jwalzerpitt</dc:creator>
      <dc:date>2020-09-29T11:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for multi-value field in which some values are listed and then aren't</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-multi-value-field-in-which-some-values-are-listed-and/m-p/221756#M65176</link>
      <description>&lt;P&gt;It would be safer to create three separate regexes. That way extraction is not affected by minor changes to the log format. I would suggest, in the field extraction UI, create three separate field extraction rules.&lt;/P&gt;

&lt;P&gt;*&lt;STRONG&gt;&lt;EM&gt;UPDATED&lt;/EM&gt;&lt;/STRONG&gt;*&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;props.conf
[stanza_name]
REPORT-extract_mv_fields: extract_url extract_src_ip extract_user

transforms.conf
[extract_url]
REGEX=(?&amp;lt;url&amp;gt;http[^\|]+)
MV_ADD=true

[extract_src_ip]
REGEX=(?&amp;lt;url&amp;gt;\d+\.\d+\.\d+\.\d+)
MV_ADD=true

[extract_user]
REGEX=\|{4}(?&amp;lt;user&amp;gt;\w+)\|{5}"
MV_ADD=true
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Oct 2016 15:31:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-multi-value-field-in-which-some-values-are-listed-and/m-p/221756#M65176</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-04T15:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for multi-value field in which some values are listed and then aren't</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-multi-value-field-in-which-some-values-are-listed-and/m-p/221757#M65177</link>
      <description>&lt;P&gt;I tried to do three separate regexes, but Splunk yelled when I tried to reuse the field extracted names (url, username, src_ip) for the second regex (logout with username).&lt;/P&gt;

&lt;P&gt;Thx&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 15:36:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-multi-value-field-in-which-some-values-are-listed-and/m-p/221757#M65177</guid>
      <dc:creator>jwalzerpitt</dc:creator>
      <dc:date>2016-10-04T15:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for multi-value field in which some values are listed and then aren't</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-multi-value-field-in-which-some-values-are-listed-and/m-p/221758#M65178</link>
      <description>&lt;P&gt;maybe, the user name and src_ip are looking good. maybe, club these two in a single rex and use a separate rex for URL.&lt;/P&gt;

&lt;P&gt;(photo is fine for reading) maybe, Can you please copy the logs and your rex as a text, so that we test it. &lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 15:44:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-multi-value-field-in-which-some-values-are-listed-and/m-p/221758#M65178</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-10-04T15:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for multi-value field in which some values are listed and then aren't</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-multi-value-field-in-which-some-values-are-listed-and/m-p/221759#M65179</link>
      <description>&lt;P&gt;I've been struggling with the frustrating code tag markdown as I selected the code button, which adds the tickmarks to the beginning and end of the code, but the page still yells at me when I go to post it&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 15:47:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-multi-value-field-in-which-some-values-are-listed-and/m-p/221759#M65179</guid>
      <dc:creator>jwalzerpitt</dc:creator>
      <dc:date>2016-10-04T15:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for multi-value field in which some values are listed and then aren't</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-multi-value-field-in-which-some-values-are-listed-and/m-p/221760#M65180</link>
      <description>&lt;P&gt;Try the updated ans&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 15:56:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-multi-value-field-in-which-some-values-are-listed-and/m-p/221760#M65180</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-04T15:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for multi-value field in which some values are listed and then aren't</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-multi-value-field-in-which-some-values-are-listed-and/m-p/221761#M65181</link>
      <description>&lt;P&gt;posting it on the comment would be difficult. maybe, please post it as a separate answer or edit your question and add the text please. &lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 16:09:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-multi-value-field-in-which-some-values-are-listed-and/m-p/221761#M65181</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-10-04T16:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for multi-value field in which some values are listed and then aren't</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-multi-value-field-in-which-some-values-are-listed-and/m-p/221762#M65182</link>
      <description>&lt;P&gt;I believe I figured it out - I had to create three separate regexes, one for each field, and when evaluating, I did not see any Non-Matches for each regex. Regexes are as follows:&lt;/P&gt;

&lt;P&gt;^(?:[^|\n]&lt;EM&gt;|){13}(?P[^|]+) &lt;BR /&gt;
^(?:[^|\n]&lt;/EM&gt;|){3}(?P[^|]+) &lt;BR /&gt;
 ^(?:[^|\n]*|){8}(?P[^|]+) &lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 16:19:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-multi-value-field-in-which-some-values-are-listed-and/m-p/221762#M65182</guid>
      <dc:creator>jwalzerpitt</dc:creator>
      <dc:date>2016-10-04T16:19:02Z</dc:date>
    </item>
  </channel>
</rss>

