<?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 Create a field from the source in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Create-a-field-from-the-source/m-p/330871#M98488</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have created fields from the raw data successfully. However now I need to extract a portion of the source data (which I imported manually into my Splunk running on a Mac) and create one field.&lt;BR /&gt;
My source data are actually multiple files that contains log and the machine identifiers is in the source path&lt;BR /&gt;
Exemple:&lt;BR /&gt;
splunk_data.zip:./var/www/temp/GetOnline/CG1111/MD/LOG.TXT&lt;BR /&gt;
splunk_data.zip:./var/www/temp/GetOnline/UV5015/MD/LOG.TXT&lt;/P&gt;

&lt;P&gt;The correct regex to extract the machine name would be:  (?&amp;lt;=ne\/).*?(?=\/MD)&lt;/P&gt;

&lt;P&gt;I have tried all possible answers from that forum and I could not create a field t.hat would include all my machine names.&lt;/P&gt;

&lt;P&gt;I was wondering if you guys can shed some light here?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 14:20:49 GMT</pubDate>
    <dc:creator>splunkbee</dc:creator>
    <dc:date>2020-09-29T14:20:49Z</dc:date>
    <item>
      <title>Create a field from the source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-field-from-the-source/m-p/330871#M98488</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have created fields from the raw data successfully. However now I need to extract a portion of the source data (which I imported manually into my Splunk running on a Mac) and create one field.&lt;BR /&gt;
My source data are actually multiple files that contains log and the machine identifiers is in the source path&lt;BR /&gt;
Exemple:&lt;BR /&gt;
splunk_data.zip:./var/www/temp/GetOnline/CG1111/MD/LOG.TXT&lt;BR /&gt;
splunk_data.zip:./var/www/temp/GetOnline/UV5015/MD/LOG.TXT&lt;/P&gt;

&lt;P&gt;The correct regex to extract the machine name would be:  (?&amp;lt;=ne\/).*?(?=\/MD)&lt;/P&gt;

&lt;P&gt;I have tried all possible answers from that forum and I could not create a field t.hat would include all my machine names.&lt;/P&gt;

&lt;P&gt;I was wondering if you guys can shed some light here?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:20:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-field-from-the-source/m-p/330871#M98488</guid>
      <dc:creator>splunkbee</dc:creator>
      <dc:date>2020-09-29T14:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create a field from the source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-field-from-the-source/m-p/330872#M98489</link>
      <description>&lt;P&gt;Try this.&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[&amp;lt;yoursourcetype&amp;gt;]
REPORT-machinename = machinename
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[machinename]
SOURCE_KEY = MetaData:Source
REGEX = (?&amp;lt;=ne\/)(?&amp;lt;machinename&amp;gt;.*)?(?=\/MD)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Jun 2017 22:54:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-field-from-the-source/m-p/330872#M98489</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-06-08T22:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create a field from the source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-field-from-the-source/m-p/330873#M98490</link>
      <description>&lt;P&gt;Thanks for your answer.&lt;/P&gt;

&lt;P&gt;I've done what you suggested but it doesn't work. I have three questions:&lt;/P&gt;

&lt;P&gt;1) There are a lot of props.conf and transforms.conf on my Mac. I created these two files under /Application/Splunk/etc/system/local and I populated them with your inputs above. Is that right?&lt;/P&gt;

&lt;P&gt;2) In your props.conf above, what would be the correct value for "yoursourcetype"?&lt;/P&gt;

&lt;P&gt;3) Then what? Restart Splunk? Restart my Mac? Re-index?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 07:48:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-field-from-the-source/m-p/330873#M98490</guid>
      <dc:creator>splunkbee</dc:creator>
      <dc:date>2017-06-09T07:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Create a field from the source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-field-from-the-source/m-p/330874#M98491</link>
      <description>&lt;P&gt;1) Which props/trasnforms files you alter may depend on your other configurations.  You can use &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.6.1/Troubleshooting/Usebtooltotroubleshootconfigurations"&gt;btool&lt;/A&gt; to ensure the configurations you create are being handled as you want them.&lt;/P&gt;

&lt;P&gt;2) That depends on what sourcetype the data is created with.  When you search for this data in your Splunk instance, what do you see for the sourcetype?&lt;/P&gt;

&lt;P&gt;3) You should not need to re-index, but you should at least perform a debug/refresh (yoursplunkhost:8000/debug/refresh, and click the button that is shown there) to inform Splunk to re-read its configuration.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 15:34:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-field-from-the-source/m-p/330874#M98491</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-06-09T15:34:12Z</dc:date>
    </item>
  </channel>
</rss>

