<?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: rex field command in props.conf file in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684393#M11429</link>
    <description>&lt;P&gt;In the props.conf example, when it says "REPORT-file_name = url_domain", what should I replace file_name with?&lt;/P&gt;&lt;P&gt;I'll stay tuned, thank you very much.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Apr 2024 16:28:57 GMT</pubDate>
    <dc:creator>pgabo66</dc:creator>
    <dc:date>2024-04-16T16:28:57Z</dc:date>
    <item>
      <title>rex field command in props.conf file</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684289#M11424</link>
      <description>&lt;P&gt;The event.url field stores all the urls found in the logs, I want to create a new field called url_domain that only captures the domain of the urls stored in event.url, temporarily what I do is from the search write the following:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| rex field=event.url "^(?:https?:\/\/)?(?:www[0-9]*\.)?(?)(?&amp;lt;url_domain&amp;gt;[^\n:\/]+)"&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;What should I add in the props.conf so that this instruction is fixed for the sourcetype "sec-web"?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 17:33:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684289#M11424</guid>
      <dc:creator>pgabo66</dc:creator>
      <dc:date>2024-04-16T17:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: rex field command in props.conf file</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684298#M11425</link>
      <description>&lt;P class=""&gt;&lt;SPAN class=""&gt;You can do this in the UI - go to Settings-&amp;gt;Fields-Field Transformations and add the regex and the field you want to extract from and then in Field Extractions add a new Extraction using transforms and reference the Field Transformation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;This will translate to something like this in props/transforms conf files&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;In transforms.conf you will need&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[url_domain]
CLEAN_KEYS = 0
REGEX = ^(?:https?:\/\/)?(?:www[0-9]*\.)?(?)(?&amp;lt;url_domain&amp;gt;[^\n:\/]+)
SOURCE_KEY = event.url&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;In props.conf&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[sec-web]
REPORT-file_name = url_domain&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 22:52:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684298#M11425</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-04-15T22:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: rex field command in props.conf file</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684299#M11426</link>
      <description>&lt;P&gt;So with the "SOURCE_KEY = event.url" what I do is call the field where I want to get the information from?&lt;BR /&gt;&amp;nbsp;In my case it would be the urls stored there.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 22:58:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684299#M11426</guid>
      <dc:creator>pgabo66</dc:creator>
      <dc:date>2024-04-15T22:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: rex field command in props.conf file</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684301#M11427</link>
      <description>&lt;P&gt;In your rex example you said&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=event.url ...&lt;/LI-CODE&gt;&lt;P&gt;that is why SOURCE_KEY is event.url - as that is where the urls are coming from right?&lt;/P&gt;&lt;P&gt;Your rex example indicated you are&amp;nbsp;&lt;STRONG&gt;extracting&amp;nbsp;&lt;/STRONG&gt;the url into a field called url_domain, which is also what is in the transforms.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 23:03:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684301#M11427</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-04-15T23:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: rex field command in props.conf file</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684327#M11428</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250525"&gt;@pgabo66&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you have to create a new field associating it to your sourcetype and using this rule:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;^(?:https?:\/\/)?(?:www[0-9]*\.)?(?)(?&amp;lt;url_domain&amp;gt;[^\n:\/]+) in event.url&lt;/LI-CODE&gt;&lt;P&gt;in the field extraction.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 05:24:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684327#M11428</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-04-16T05:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: rex field command in props.conf file</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684393#M11429</link>
      <description>&lt;P&gt;In the props.conf example, when it says "REPORT-file_name = url_domain", what should I replace file_name with?&lt;/P&gt;&lt;P&gt;I'll stay tuned, thank you very much.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 16:28:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684393#M11429</guid>
      <dc:creator>pgabo66</dc:creator>
      <dc:date>2024-04-16T16:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: rex field command in props.conf file</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684430#M11430</link>
      <description>&lt;P&gt;I did what you explained to me but it still doesn't work, when I check the zscaler logs apun the url_domain field does not appear.&lt;/P&gt;&lt;P&gt;It is important to mention that I am implementing this from a custom app for zsacaler.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 22:53:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684430#M11430</guid>
      <dc:creator>pgabo66</dc:creator>
      <dc:date>2024-04-16T22:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: rex field command in props.conf file</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684431#M11431</link>
      <description>&lt;P&gt;Do you have an example of how the props.conf would look like with that rule?&lt;/P&gt;&lt;P&gt;I've tried several sentences but it still doesn't take it.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 22:55:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684431#M11431</guid>
      <dc:creator>pgabo66</dc:creator>
      <dc:date>2024-04-16T22:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: rex field command in props.conf file</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684436#M11432</link>
      <description>&lt;LI-CODE lang="markup"&gt;REPORT-url_domain&lt;/LI-CODE&gt;&lt;P&gt;It's the name of the field you want to assign the result to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 00:08:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684436#M11432</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-04-17T00:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: rex field command in props.conf file</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684474#M11433</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;here is order how those are managed in search time&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Searchtimeoperationssequence" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Searchtimeoperationssequence&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You should ensure that this field has defined before you can use those e.g. in transforms.conf. E.g. if you are using ALIAS-field1 on props.conf you cannot use that field1 as &amp;nbsp;a SOURCE_KEY in props.conf. In this kind of situation you should extract that information from _raw instead of field which has defined on later phase of input sequence.&lt;/P&gt;&lt;P&gt;I'm not sure about your event.url field is same as this TA has defined or not. If it's then you can see in props.conf that it has defined like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EVAL-url = Host+URL&lt;/LI-CODE&gt;&lt;P&gt;and if this is your event.url field then it didn't &amp;nbsp;exists yet when you try to use it on transforms.conf.&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 08:52:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684474#M11433</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-04-17T08:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: rex field command in props.conf file</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684579#M11435</link>
      <description>&lt;P&gt;It is probably because your field looks like it has come from JSON and based on the link provided by&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp;, means that the field extractions are happening at stage 4, whereas your REPORT extraction is happening at stage 3, therefore the field does not exist.&lt;/P&gt;&lt;P&gt;You could try creating a calculated field using an eval replace expression to remove the non-domain part.&lt;/P&gt;&lt;P&gt;You can try this in standard SPL by experimenting with your regex using&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval domain=replace('event.url', "(?:https?:\/\/)?(?:www[0-9]*\.)?(?)([^\n:\/]+)", "\1")&lt;/LI-CODE&gt;&lt;P&gt;That is NOT correct above, as I am not sure what the replacement token \1 should be with all the brackets and capturing/non-capturing groups, but you can experiment with regex101.com&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 22:40:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/684579#M11435</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-04-17T22:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: rex field command in props.conf file</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/685685#M11451</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;I have tried the ways shared by you but it still doesn't work it's like Splunk doesn't read the transforms.conf I checked the logs of the index=_internal but I don't see any errors related to it.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 20:45:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/rex-field-command-in-props-conf-file/m-p/685685#M11451</guid>
      <dc:creator>pgabo66</dc:creator>
      <dc:date>2024-04-26T20:45:23Z</dc:date>
    </item>
  </channel>
</rss>

