<?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: Create a field from values with the source field in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-field-from-values-with-the-source-field/m-p/636348#M108848</link>
    <description>&lt;P&gt;Hello Vishal,&lt;/P&gt;&lt;P&gt;is the folder structure always the same? If yes, this should work:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=source "Daily Reporting\\(?&amp;lt;business_unit&amp;gt;[^\\]+)"&lt;/LI-CODE&gt;&lt;P&gt;If not you could use this regex:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;\\\\[^\\]+\\[^\\]+\\[^\\]+\\[^\\]+\\[^\\]+\\(?&amp;lt;business_unit&amp;gt;[^\\]+)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to include this to props.conf and transforms.conf try something like this:&lt;/P&gt;&lt;P&gt;props.conf&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[sourcetype]
REPORT-my_fields = business_unit&lt;/LI-CODE&gt;&lt;P&gt;transforms.conf&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[business_unit]
SOURCE_KEY = source
REGEX = one of the above mentioned regex&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this helps please upvote my answer.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;</description>
    <pubDate>Tue, 28 Mar 2023 15:39:49 GMT</pubDate>
    <dc:creator>vsommer</dc:creator>
    <dc:date>2023-03-28T15:39:49Z</dc:date>
    <item>
      <title>How to create a field from values with the source field?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-field-from-values-with-the-source-field/m-p/636344#M108846</link>
      <description>&lt;P&gt;I've created fields from regex expressions before but never from the source field.&lt;/P&gt;
&lt;P data-unlink="true"&gt;This is an example of the value within the source field:&lt;BR /&gt;&amp;nbsp;\\host0000\Test\IT Information\ Data Files\Daily Reporting\Business Unit\&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;I would like to extract the business unit value and call it Business Unit.&lt;/P&gt;
&lt;P data-unlink="true"&gt;I have access to create a props.conf file.&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;Can you help?&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;Kind regards,&lt;/P&gt;
&lt;P data-unlink="true"&gt;Vishal&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 16:23:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-field-from-values-with-the-source-field/m-p/636344#M108846</guid>
      <dc:creator>vishalduttauk</dc:creator>
      <dc:date>2023-03-28T16:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create a field from values with the source field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-field-from-values-with-the-source-field/m-p/636346#M108847</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/228513"&gt;@vishalduttauk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if the number ot subfolders in path is fixed you can use this regex in a search:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=source "\\(\\[^\\]+){5}\\(?&amp;lt;business_unit&amp;gt;[^\\]+)"&lt;/LI-CODE&gt;&lt;P&gt;if instead you want to use this regex in a field extraction, you can use:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;\\(\\[^\\]+){5}\\(?&amp;lt;business_unit&amp;gt;[^\\]+) in source&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 15:35:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-field-from-values-with-the-source-field/m-p/636346#M108847</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-03-28T15:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create a field from values with the source field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-field-from-values-with-the-source-field/m-p/636348#M108848</link>
      <description>&lt;P&gt;Hello Vishal,&lt;/P&gt;&lt;P&gt;is the folder structure always the same? If yes, this should work:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=source "Daily Reporting\\(?&amp;lt;business_unit&amp;gt;[^\\]+)"&lt;/LI-CODE&gt;&lt;P&gt;If not you could use this regex:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;\\\\[^\\]+\\[^\\]+\\[^\\]+\\[^\\]+\\[^\\]+\\(?&amp;lt;business_unit&amp;gt;[^\\]+)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to include this to props.conf and transforms.conf try something like this:&lt;/P&gt;&lt;P&gt;props.conf&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[sourcetype]
REPORT-my_fields = business_unit&lt;/LI-CODE&gt;&lt;P&gt;transforms.conf&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[business_unit]
SOURCE_KEY = source
REGEX = one of the above mentioned regex&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this helps please upvote my answer.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 15:39:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-field-from-values-with-the-source-field/m-p/636348#M108848</guid>
      <dc:creator>vsommer</dc:creator>
      <dc:date>2023-03-28T15:39:49Z</dc:date>
    </item>
  </channel>
</rss>

