<?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 concatenation in props &amp; transforms in Splunk ITSI</title>
    <link>https://community.splunk.com/t5/Splunk-ITSI/Regex-concatenation-in-props-amp-transforms/m-p/469573#M1702</link>
    <description>&lt;P&gt;I solved this by using EVAL in props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EVAL-url = if(isnull(contact_type),url,url . "/NIN/contactType/" . contact_type)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[uri_path_1]
REGEX = uri":"(?&amp;lt;url&amp;gt;[\/A-Za-z]+)


[uri_path_2]
REGEX = uri":"(?&amp;lt;url&amp;gt;[\/A-Za-z]+)\?id=(?&amp;lt;NIN&amp;gt;\w+)&amp;amp;contactType=(?&amp;lt;contact_type&amp;gt;\w+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 12 Feb 2020 08:08:55 GMT</pubDate>
    <dc:creator>ialahdal</dc:creator>
    <dc:date>2020-02-12T08:08:55Z</dc:date>
    <item>
      <title>Regex concatenation in props &amp; transforms</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/Regex-concatenation-in-props-amp-transforms/m-p/469572#M1701</link>
      <description>&lt;P&gt;I am using regex to extract a field but I need 2 different regex.&lt;BR /&gt;
so under transforms.conf I made 2 different regex but with the same field, under props I called them.&lt;/P&gt;

&lt;P&gt;I seek to achieve 3 things,&lt;/P&gt;

&lt;P&gt;1- mask data in uri if needed&lt;BR /&gt;
2- concatenate fields if masked&lt;BR /&gt;
3- extract uri&lt;/P&gt;

&lt;P&gt;URIs come in 2 different forms&lt;BR /&gt;
1- &lt;STRONG&gt;uri_path&lt;/STRONG&gt; all letters with 1 field to extract: i.e &lt;STRONG&gt;/Core/Test/&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;2-  &lt;STRONG&gt;uri_path_profile&lt;/STRONG&gt; letters &amp;amp; numbers with 3 fields to extract i.e&lt;BR /&gt;
*&lt;EM&gt;/Test/?id={NIN}&amp;amp;contactType={type}&lt;BR /&gt;
*&lt;/EM&gt; where NIN is any 10 digit combination, and type is one out 3 possible strings&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#Field extraction for uri path
[uri_path]
REGEX = uri":"([\/A-Za-z]+)
FORMAT = uri::$1

[uri_path_profile]
REGEX = uri":"([\/A-Za-z]+)\?id=(\w+)&amp;amp;contactType=(\w+)
FORMAT = uri::$1?id=NIN&amp;amp;contactType=$3 NIN::$2 contact_type::$3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My end goal is to have both extracted regex into one field called uri but since the fields in the 2nd stanza is dynamic and will have a lot of entries i'd like them to all be made into one which would be &lt;BR /&gt;
&lt;STRONG&gt;uri=/Test/?id=NIN&amp;amp;contactType=(group_3_value)&lt;/STRONG&gt; so even if NIN has thousands of different records it will only show the 3 different strings at the end&lt;/P&gt;

&lt;P&gt;is this doable? &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:09:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/Regex-concatenation-in-props-amp-transforms/m-p/469572#M1701</guid>
      <dc:creator>ialahdal</dc:creator>
      <dc:date>2020-09-30T04:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regex concatenation in props &amp; transforms</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/Regex-concatenation-in-props-amp-transforms/m-p/469573#M1702</link>
      <description>&lt;P&gt;I solved this by using EVAL in props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EVAL-url = if(isnull(contact_type),url,url . "/NIN/contactType/" . contact_type)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[uri_path_1]
REGEX = uri":"(?&amp;lt;url&amp;gt;[\/A-Za-z]+)


[uri_path_2]
REGEX = uri":"(?&amp;lt;url&amp;gt;[\/A-Za-z]+)\?id=(?&amp;lt;NIN&amp;gt;\w+)&amp;amp;contactType=(?&amp;lt;contact_type&amp;gt;\w+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Feb 2020 08:08:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/Regex-concatenation-in-props-amp-transforms/m-p/469573#M1702</guid>
      <dc:creator>ialahdal</dc:creator>
      <dc:date>2020-02-12T08:08:55Z</dc:date>
    </item>
  </channel>
</rss>

