<?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 to move three values into sourcetype field with transforms.conf in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369203#M160582</link>
    <description>&lt;P&gt;The reason for the new sourcetypes , each of the values represent a different log source as I am parsing data from a firewall.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jun 2017 12:57:02 GMT</pubDate>
    <dc:creator>pbugeja</dc:creator>
    <dc:date>2017-06-23T12:57:02Z</dc:date>
    <item>
      <title>Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369198#M160577</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am very new with Regex and have been struggling with simple task.&lt;/P&gt;

&lt;P&gt;I need to change three values (Health, AuditTrail, Security)  in a field called type into individual sourcetypes.&lt;/P&gt;

&lt;P&gt;Any assistance would be greatly appreciated. &lt;/P&gt;

&lt;P&gt;Thanks, Paul&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 20:40:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369198#M160577</guid>
      <dc:creator>pbugeja</dc:creator>
      <dc:date>2017-06-22T20:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369199#M160578</link>
      <description>&lt;P&gt;We'd need sample events and mock output to help you accurately. Also, assuming this needs to be done at index-time. Correct me if I'm wrong.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 21:29:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369199#M160578</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-06-22T21:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369200#M160579</link>
      <description>&lt;P&gt;Good call, somesoni2! I wasn't even thinking index time until I saw what you said, then I looked at the question again to see that it said sourcetypes. Hopefully everyone that reads this one will give answers that are index time answers.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 23:44:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369200#M160579</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-06-22T23:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369201#M160580</link>
      <description>&lt;P&gt;Appreciate you responding to my question.&lt;/P&gt;

&lt;P&gt;I would like to do query my data at search time.&lt;/P&gt;

&lt;P&gt;field=type&lt;BR /&gt;
value=Health,AuditTrail,Security&lt;/P&gt;

&lt;P&gt;Need to create new sourcetypes with each value: sourcetype=Health;sourcetype=AuditTrail;sourcetype=Security&lt;/P&gt;

&lt;P&gt;Thanks, Paul&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 12:17:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369201#M160580</guid>
      <dc:creator>pbugeja</dc:creator>
      <dc:date>2017-06-23T12:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369202#M160581</link>
      <description>&lt;P&gt;I'm afraid this is not possible. The sourcetype of an event is a indexed field, and cannot be changed during search time.&lt;/P&gt;

&lt;P&gt;Can you please elaborate why you want to have different sourcetypes here? Maybe there is a easy solution for your problem.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 12:43:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369202#M160581</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2017-06-23T12:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369203#M160582</link>
      <description>&lt;P&gt;The reason for the new sourcetypes , each of the values represent a different log source as I am parsing data from a firewall.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 12:57:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369203#M160582</guid>
      <dc:creator>pbugeja</dc:creator>
      <dc:date>2017-06-23T12:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369204#M160583</link>
      <description>&lt;P&gt;I still don't quite understand the need for a different source type here. Do these logs have different formats, or do you just want to spilt the log sources by sourcetype? Because there are many other possibilities of splitting/grouping events (think of eventtypes etc)&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 13:29:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369204#M160583</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2017-06-23T13:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369205#M160584</link>
      <description>&lt;P&gt;Yes, we want to split the log sources by sourcetype.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 13:32:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369205#M160584</guid>
      <dc:creator>pbugeja</dc:creator>
      <dc:date>2017-06-23T13:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369206#M160585</link>
      <description>&lt;P&gt;With this I simply moved the "type" field into the "sourcetype" field, but I want the values from "type" into "sourcetype".&lt;/P&gt;

&lt;P&gt;REGEX = type=(?P[^;]+);&lt;BR /&gt;
FORMAT = sourcetype::$1&lt;BR /&gt;
DEST_KEY = MetaData:Sourcetype&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 13:34:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369206#M160585</guid>
      <dc:creator>pbugeja</dc:creator>
      <dc:date>2017-06-23T13:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369207#M160586</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Just as a note here:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Best practice would be to use a syslog server, like rsyslog or syslog-ng. Then pass the data to the indexers either by using an HTTP Event Collector or a UF or HF. It is harder to loose UDP data that way. Any restart of the Splunk (or syslog service, too) processing will result in a loss of data until the service comes back up. The UF and HF will take many times longer to restore the reception of the data.&lt;/P&gt;

&lt;P&gt;If the amount of data coming in is not significant, then perhaps that doesn't matter, but I have one syslog server getting about 800GB/day of syslog data and it is working great (rsyslog -&amp;gt; nginx for load balancing -&amp;gt; indexers with HEC). You can get almost that with a UF alone, but you can't do any kind of parsing of that data to help you out, like separating data to different indexes. If you use an HF, then you will get about a third of that volume. But again, when you restart your Splunk process, you will loose more data than with a syslog server. I use rsyslog, and it's down less than a second, but when we used a UF, it took more than a minute, all the while dropping those UDP packets into the bit bucket.&lt;/P&gt;

&lt;P&gt;It is also possible to sourcetype the data at the syslog level, which puts less strain on your indexers.&lt;/P&gt;

&lt;P&gt;Something to think about while you are implementing your solution.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 13:54:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369207#M160586</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-06-23T13:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369208#M160587</link>
      <description>&lt;P&gt;I appreciate your recommendation, but I have been tasked with the segmenting of the different logs with individual sourcetypes as the data is combined from the cloud firewall. &lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 14:04:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369208#M160587</guid>
      <dc:creator>pbugeja</dc:creator>
      <dc:date>2017-06-23T14:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369209#M160588</link>
      <description>&lt;P&gt;Note in the above answer:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;It is also possible to sourcetype the data at the syslog level, which puts less strain on your indexers.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Which is what you said that you were tasked with doing.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 14:14:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369209#M160588</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-06-23T14:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369210#M160589</link>
      <description>&lt;P&gt;currently the following rex command is creating new sourcetypes, but I still need assistance the props or transforms conf files.&lt;/P&gt;

&lt;P&gt;index="cato_dev"  source=CATOLOG.TXT | rex field=type "(?.*)"&lt;/P&gt;

&lt;P&gt;adds the Health, AuditTrail and Security sourcetypes&lt;/P&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
[cato:logs]&lt;BR /&gt;
CHARSET = UTF-8&lt;BR /&gt;
SHOULD_LINEMERGE = True&lt;BR /&gt;
KV_MODE = json&lt;BR /&gt;
TRANSFORMS-changesourcetype = cato:logs&lt;/P&gt;

&lt;P&gt;[source::/opt/splunk/etc/apps/Cato_Input/CATOLOG.TXT]&lt;BR /&gt;
TRANSFORMS-changesourcetype = cato:logs&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;BR /&gt;
[cato:logs]&lt;BR /&gt;
REGEX field=type "(?.*)"&lt;BR /&gt;
FORMAT = sourcetype::cato:logs&lt;BR /&gt;
DEST_KEY = MetaData:Sourcetype&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:39:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369210#M160589</guid>
      <dc:creator>pbugeja</dc:creator>
      <dc:date>2020-09-29T14:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369211#M160590</link>
      <description>&lt;P&gt;Currently I am able to create the new sourcetypes with the following rex command, but still have a problem with either the props or transforms conf file.  I guess there is a syntax issue.&lt;/P&gt;

&lt;P&gt;This works &amp;gt; index="cato_dev" | rex field=type "(?.*)"&lt;/P&gt;

&lt;P&gt;sourcetypes:Health;AuditTrail;Security&lt;/P&gt;

&lt;P&gt;transform.conf&lt;BR /&gt;
[cato:logs]&lt;BR /&gt;
REGEX field=type "(?.*)"&lt;BR /&gt;
FORMAT = sourcetype::cato:logs&lt;BR /&gt;
DEST_KEY = MetaData:Sourcetype&lt;/P&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
[cato:logs]&lt;BR /&gt;
CHARSET = UTF-8&lt;BR /&gt;
SHOULD_LINEMERGE = True&lt;BR /&gt;
KV_MODE = json&lt;BR /&gt;
TRANSFORMS-changesourcetype = cato:logs&lt;/P&gt;

&lt;P&gt;[source::/opt/splunk/etc/apps/Cato_Input/CATOLOG.TXT]&lt;BR /&gt;
TRANSFORMS-changesourcetype = cato:logs&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:34:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369211#M160590</guid>
      <dc:creator>pbugeja</dc:creator>
      <dc:date>2020-09-29T14:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369212#M160591</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;FORMAT = sourcetype::$1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Jun 2017 20:07:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369212#M160591</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-06-25T20:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369213#M160592</link>
      <description>&lt;P&gt;Hi cpetterborg,&lt;BR /&gt;
I unfortunately started with "FORMAT = sourcetype::$1"  with the same effect. &lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 20:11:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369213#M160592</guid>
      <dc:creator>pbugeja</dc:creator>
      <dc:date>2017-06-25T20:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369214#M160593</link>
      <description>&lt;P&gt;Okay, here we go. Let's try this:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;CHARSET = UTF-8
SHOULD_LINEMERGE = True
# If your data is JSON, then the transforms.conf file will need a different REGEX statement the you were using
KV_MODE = json
TRANSFORMS-changesourcetype = cato:logs
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[cato:logs]
# From what I could understand, you gave the explanation of the JSON data with the field that looked like:
#     "type"="value"
# so the regex might be your problem. The following will put the value in the capture group:
REGEX = \"type\"=\"(\w+)\"
# which would make it find the field value from the JSON string
#
# this FORMAT really should say $1, which is the capture group designation for what is matched in the parens:
FORMAT = sourcetype::$1
DEST_KEY = MetaData:Sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I'm wrong about the actual format (you didn't give an actual example of the data), then please provide an example of the data. That will make it much easier to help you. I'm going just from the fact that you provided a rex command which looks like it might work. Hopefully I got it right, and didn't make any typos. I think I got it right, though.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 20:53:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369214#M160593</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-06-25T20:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369215#M160594</link>
      <description>&lt;P&gt;I tried your regex and unfortunately did not work.&lt;/P&gt;

&lt;P&gt;My rex command did add my the new sourcetypes as a search. &lt;BR /&gt;
index="cato_dev" | rex field=type (?.*)&lt;BR /&gt;
with the above it added sourcetype: Health, AuditTrail, Security&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 22:27:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369215#M160594</guid>
      <dc:creator>pbugeja</dc:creator>
      <dc:date>2017-06-25T22:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369216#M160595</link>
      <description>&lt;P&gt;This is my command minus the two astericks before and after the search command&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;index="cato_dev" | rex field=type (?.*)&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 22:36:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369216#M160595</guid>
      <dc:creator>pbugeja</dc:creator>
      <dc:date>2017-06-25T22:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to move three values into sourcetype field with transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369217#M160596</link>
      <description>&lt;P&gt;sorry but my regex command is being edited.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 22:45:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-move-three-values-into-sourcetype-field-with-transforms/m-p/369217#M160596</guid>
      <dc:creator>pbugeja</dc:creator>
      <dc:date>2017-06-25T22:45:24Z</dc:date>
    </item>
  </channel>
</rss>

