<?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 in transform.conf to extract hostname after equal to sign in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405714#M71995</link>
    <description>&lt;P&gt;I don't see anything obviously wrong with that. Perhaps try without the &lt;CODE&gt;.+&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Also:&lt;BR /&gt;
did you restart the respective splunk instance after adding this config?&lt;BR /&gt;
You realize this will only apply to newly ingested events?&lt;BR /&gt;
What does your splunk architecture look like for this data feed and where did you deploy this config in that architecture?&lt;/P&gt;</description>
    <pubDate>Wed, 28 Nov 2018 13:31:29 GMT</pubDate>
    <dc:creator>FrankVl</dc:creator>
    <dc:date>2018-11-28T13:31:29Z</dc:date>
    <item>
      <title>regex in transform.conf to extract hostname after equal to sign</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405709#M71990</link>
      <description>&lt;P&gt;Hi, I need help in extracting the hostname after equal to sign in the transform.conf file. The string pattern is like this &lt;/P&gt;

&lt;P&gt;cs1=host-name-01-02&lt;/P&gt;

&lt;P&gt;I tried the pattern but it seems to not work. &lt;BR /&gt;
REGEX = .+cs1=(\S+)&lt;/P&gt;

&lt;P&gt;could someone help?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Dinesh&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 11:40:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405709#M71990</guid>
      <dc:creator>dbashyam</dc:creator>
      <dc:date>2018-11-28T11:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: regex in transform.conf to extract hostname after equal to sign</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405710#M71991</link>
      <description>&lt;P&gt;@dbashyam &lt;/P&gt;

&lt;P&gt;I think &lt;CODE&gt;cs1&lt;/CODE&gt; should extract automatically.  Can you please share full sample event ? So we can work on right path.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 12:22:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405710#M71991</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-11-28T12:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: regex in transform.conf to extract hostname after equal to sign</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405711#M71992</link>
      <description>&lt;P&gt;Hi, below is the sample.&lt;/P&gt;

&lt;P&gt;Nov 28 10:11:06 fwrw dbn: arf:0|data|data|0.0.1|1|repeat_event|7|cs1Label=system identifier cs1=MM63-GH-CG-A-0101 system_identifier=DB63-GH-CG-A-0101 externalId=10043284 cnt=63784 rt=12345 start=123456  destinationServiceName=dummy cn1Label=statement identifier&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:08:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405711#M71992</guid>
      <dc:creator>dbashyam</dc:creator>
      <dc:date>2020-09-29T22:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: regex in transform.conf to extract hostname after equal to sign</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405712#M71993</link>
      <description>&lt;P&gt;What does the rest of your props and transforms look like for this (maybe the issue isn't with the regex itself).&lt;/P&gt;

&lt;P&gt;For the regex: that &lt;CODE&gt;.+&lt;/CODE&gt; is not very useful, try without it.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 13:23:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405712#M71993</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-11-28T13:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: regex in transform.conf to extract hostname after equal to sign</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405713#M71994</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;the props.conf contains&lt;/P&gt;

&lt;P&gt;[dbnetworks:monitor:file]&lt;BR /&gt;
TRANSFORMS-DBN = DBNsyslog&lt;/P&gt;

&lt;P&gt;the transforms.conf contains&lt;/P&gt;

&lt;P&gt;[DBNsyslog]&lt;BR /&gt;
REGEX = .+cs1=(\S+)&lt;BR /&gt;
FORMAT = host::$1&lt;BR /&gt;
DEST_KEY = MetaData:Host&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 13:27:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405713#M71994</guid>
      <dc:creator>dbashyam</dc:creator>
      <dc:date>2018-11-28T13:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: regex in transform.conf to extract hostname after equal to sign</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405714#M71995</link>
      <description>&lt;P&gt;I don't see anything obviously wrong with that. Perhaps try without the &lt;CODE&gt;.+&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Also:&lt;BR /&gt;
did you restart the respective splunk instance after adding this config?&lt;BR /&gt;
You realize this will only apply to newly ingested events?&lt;BR /&gt;
What does your splunk architecture look like for this data feed and where did you deploy this config in that architecture?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 13:31:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405714#M71995</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-11-28T13:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: regex in transform.conf to extract hostname after equal to sign</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405715#M71996</link>
      <description>&lt;P&gt;Have you tried using the Extract New Fields? If you go into "Extract New Fields" select the event that you want, select Regular Expression, then next. Highlight the text that you want extracted, give it a test name. You can then select 'Show Regular Expression', and it will give you a pretty good idea of what Splunk is looking for as far as Regular Expressions go. I have found this method to work most of the time. Using sites like regex101 is useful, although I have put Regex's that I pulled from the above method, not return the same results in regex101. You  might have to tweak the regex that you get from the above method, but usually the tweaking is minimal.&lt;/P&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 14:29:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405715#M71996</guid>
      <dc:creator>joebisesi</dc:creator>
      <dc:date>2018-11-28T14:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: regex in transform.conf to extract hostname after equal to sign</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405716#M71997</link>
      <description>&lt;P&gt;Not sure if I would really agree with that suggestion. Yes it can give some inspiration, but the regexes generated that way are often overly complex and not the most sensible solution.&lt;/P&gt;

&lt;P&gt;It is worth investing some time in learning regex and writing your own, by understanding the data structure, rather than relying on automated tools to generate stuff like this for you.&lt;/P&gt;

&lt;P&gt;For example in this case, this is what Splunk comes up with: &lt;CODE&gt;^(?:[^=\n]*=){2}(?P&amp;lt;host&amp;gt;[^ ]+)&lt;/CODE&gt;, while &lt;CODE&gt;cs1=(\S+)&lt;/CODE&gt; should do just fine.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 14:41:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405716#M71997</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-11-28T14:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: regex in transform.conf to extract hostname after equal to sign</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405717#M71998</link>
      <description>&lt;P&gt;I agree that the regexes generated that way are overly complex. Although sometimes, at least what I have found, is the ones that are generated will work in Splunk, and the regexes that are you can create and test in other environments don't work. In addition, by generating the overly complex ones, you can put them in something like regex101 and you can start to understand regex and how to work with the data.&lt;/P&gt;

&lt;P&gt;One question for you. Do you have or know of a good site to learn regex? I have not found any that I would recommend. I have learned by taking generated regexes and breaking them down. So I'm sure I have several regexes that are not written in the best way.  &lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 15:01:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405717#M71998</guid>
      <dc:creator>joebisesi</dc:creator>
      <dc:date>2018-11-28T15:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: regex in transform.conf to extract hostname after equal to sign</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405718#M71999</link>
      <description>&lt;P&gt;I also mostly learned by doing and trying to understand regexes created by others / found in splunkbase apps etc. So no, I don't have a site that is good for learning. Although regex101 does also have content (bottom right corner) explaining the various regex concepts, but that is a bit limited in the amount of explanation and examples given.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 15:09:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405718#M71999</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-11-28T15:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: regex in transform.conf to extract hostname after equal to sign</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405719#M72000</link>
      <description>&lt;P&gt;That's pretty much what I do&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 15:20:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405719#M72000</guid>
      <dc:creator>joebisesi</dc:creator>
      <dc:date>2018-11-28T15:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: regex in transform.conf to extract hostname after equal to sign</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405720#M72001</link>
      <description>&lt;P&gt;thanks @FrankVl your suggestion of removing the .+ did the trick.  &lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 12:37:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405720#M72001</guid>
      <dc:creator>dbashyam</dc:creator>
      <dc:date>2018-12-02T12:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: regex in transform.conf to extract hostname after equal to sign</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405721#M72002</link>
      <description>&lt;P&gt;That's good to hear! I converted my comment to an answer, so you can mark it as accepted.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 08:39:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/regex-in-transform-conf-to-extract-hostname-after-equal-to-sign/m-p/405721#M72002</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-12-03T08:39:25Z</dc:date>
    </item>
  </channel>
</rss>

