<?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: How to figure out the exact regex to capture the hostname value from the event logs for transforms.conf? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-figure-out-the-exact-regex-to-capture-the-hostname-value/m-p/422490#M121306</link>
    <description>&lt;P&gt;hey the above regex capture both  &lt;STRONG&gt;vsys1,dwest01fw&lt;/STRONG&gt; , need a regex to capture only this value  &lt;STRONG&gt;dwest01fw&lt;/STRONG&gt; from the event data. &lt;/P&gt;

&lt;P&gt;Sample data:&lt;BR /&gt;
May 29 14:51:56 deast01pano.xxxxx.com 1,2018/05/29 14:51:56,012501001022,6553964590112973819,0x8000000000000000,USERID,login,2049,2018/05/29 14:51:50,0,0,0,0,vsys1,dwest01fw,1,vsys1,10.142.10.172,xxxxx\pulse,deast01fwua.xxxxx.com,0,1,2700,0,0,agent,,0,0,,2018/05/29 14:51:47,1,0,0,0x0,xxxxx\pulse&lt;/P&gt;</description>
    <pubDate>Tue, 29 May 2018 16:32:29 GMT</pubDate>
    <dc:creator>Hemnaath</dc:creator>
    <dc:date>2018-05-29T16:32:29Z</dc:date>
    <item>
      <title>How to figure out the exact regex to capture the hostname value from the event logs for transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-figure-out-the-exact-regex-to-capture-the-hostname-value/m-p/422488#M121304</link>
      <description>&lt;P&gt;Hi,  I'm sure this is really simple but I've been unable to figure out the exact regex to capture the hostname value from the event logs. &lt;/P&gt;

&lt;P&gt;Sample data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;May 29 14:51:56 deast01pano.xxxxx.com 1,2018/05/29 14:51:56,012501001022,6553964590112973819,0x8000000000000000,USERID,login,2049,2018/05/29 14:51:50,0,0,0,0,vsys1,dwest01fw,1,vsys1,10.142.10.172,xxxxx\pulse,deast01fwua.xxxxx.com,0,1,2700,0,0,agent,,0,0,,2018/05/29 14:51:47,1,0,0,0x0,xxxxx\pulse
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to capture &lt;STRONG&gt;dwest01fw&lt;/STRONG&gt;  and replace it in the host field. I tried this regex and tested in regex101.com but it failed to capture the host .&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;USERID,.+,vsys1,(\w+).+$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Transform syntax :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[pan_vsys1_host]
REGEX = USERID,.+,vsys1,(\w+).+$
DEST_KEY = MetaData:Host
FORMAT = host::$1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Kindly guide me on this.&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 16:14:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-figure-out-the-exact-regex-to-capture-the-hostname-value/m-p/422488#M121304</guid>
      <dc:creator>Hemnaath</dc:creator>
      <dc:date>2018-05-29T16:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to figure out the exact regex to capture the hostname value from the event logs for transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-figure-out-the-exact-regex-to-capture-the-hostname-value/m-p/422489#M121305</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[pan_vsys1_host]
 REGEX = USERID,([^,]+,){8}(\w+)
 DEST_KEY = MetaData:Host
 FORMAT = host::$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://regex101.com/r/hn695t/1"&gt;https://regex101.com/r/hn695t/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 16:24:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-figure-out-the-exact-regex-to-capture-the-hostname-value/m-p/422489#M121305</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-29T16:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to figure out the exact regex to capture the hostname value from the event logs for transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-figure-out-the-exact-regex-to-capture-the-hostname-value/m-p/422490#M121306</link>
      <description>&lt;P&gt;hey the above regex capture both  &lt;STRONG&gt;vsys1,dwest01fw&lt;/STRONG&gt; , need a regex to capture only this value  &lt;STRONG&gt;dwest01fw&lt;/STRONG&gt; from the event data. &lt;/P&gt;

&lt;P&gt;Sample data:&lt;BR /&gt;
May 29 14:51:56 deast01pano.xxxxx.com 1,2018/05/29 14:51:56,012501001022,6553964590112973819,0x8000000000000000,USERID,login,2049,2018/05/29 14:51:50,0,0,0,0,vsys1,dwest01fw,1,vsys1,10.142.10.172,xxxxx\pulse,deast01fwua.xxxxx.com,0,1,2700,0,0,agent,,0,0,,2018/05/29 14:51:47,1,0,0,0x0,xxxxx\pulse&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 16:32:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-figure-out-the-exact-regex-to-capture-the-hostname-value/m-p/422490#M121306</guid>
      <dc:creator>Hemnaath</dc:creator>
      <dc:date>2018-05-29T16:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to figure out the exact regex to capture the hostname value from the event logs for transforms.conf?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-figure-out-the-exact-regex-to-capture-the-hostname-value/m-p/422491#M121307</link>
      <description>&lt;P&gt;Hey, what @somesoni2 posted will work fine. The first capture group captures the &lt;CODE&gt;vsys1&lt;/CODE&gt;, the second one captures the &lt;CODE&gt;dwest01fw&lt;/CODE&gt;, but only the second one is then used in the FORMAT line.&lt;/P&gt;

&lt;P&gt;You could also use this:&lt;BR /&gt;
&lt;A href="https://regex101.com/r/6U1pkt/1"&gt;https://regex101.com/r/6U1pkt/1&lt;/A&gt;&lt;BR /&gt;
You would have to use $1 in the FORMAT line. Both solutions should work fine. &lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 16:55:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-figure-out-the-exact-regex-to-capture-the-hostname-value/m-p/422491#M121307</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-05-29T16:55:28Z</dc:date>
    </item>
  </channel>
</rss>

