<?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 create a regex for extracting few characters of a field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-for-extracting-few-characters-of-a-field/m-p/396704#M115193</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try this,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval VLAN ="Vlan819(RVP_CDN)" 
| eval result = mvindex(split(VLAN,"("),0)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 15 Jul 2019 16:32:41 GMT</pubDate>
    <dc:creator>vnravikumar</dc:creator>
    <dc:date>2019-07-15T16:32:41Z</dc:date>
    <item>
      <title>How to create a regex for extracting few characters of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-for-extracting-few-characters-of-a-field/m-p/396701#M115190</link>
      <description>&lt;P&gt;My VLAN value looks like below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup vrf_usage.csv | search VRF="*" | search VLAN=Vlan819(RVP_CDN) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Could you please help me getting VLAN value as Vlan819 just before ( symbol. That is just before the bracket starts.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 10:25:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-for-extracting-few-characters-of-a-field/m-p/396701#M115190</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2019-07-15T10:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regex for extracting few characters of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-for-extracting-few-characters-of-a-field/m-p/396702#M115191</link>
      <description>&lt;P&gt;@surekhasplunk ,&lt;/P&gt;

&lt;P&gt;Try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex field=VLAN "(?&amp;lt;VLAN&amp;gt;.+)\("
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Jul 2019 10:55:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-for-extracting-few-characters-of-a-field/m-p/396702#M115191</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-07-15T10:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regex for extracting few characters of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-for-extracting-few-characters-of-a-field/m-p/396703#M115192</link>
      <description>&lt;P&gt;Hi surekhasplunk,&lt;BR /&gt;
it could be useful to share a sample of your logs.&lt;BR /&gt;
Anyway, you could use something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "Vlan819&amp;lt;VLAN&amp;gt;\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to test with a sample.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 10:57:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-for-extracting-few-characters-of-a-field/m-p/396703#M115192</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-07-15T10:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regex for extracting few characters of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-for-extracting-few-characters-of-a-field/m-p/396704#M115193</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try this,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval VLAN ="Vlan819(RVP_CDN)" 
| eval result = mvindex(split(VLAN,"("),0)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Jul 2019 16:32:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-for-extracting-few-characters-of-a-field/m-p/396704#M115193</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-07-15T16:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regex for extracting few characters of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-for-extracting-few-characters-of-a-field/m-p/396705#M115194</link>
      <description>&lt;P&gt;Looks great - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval VLAN="Vlan819(RVP_CDN)" 
| rex field=VLAN "(?&amp;lt;VLAN&amp;gt;.+)\("
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Jul 2019 18:33:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-for-extracting-few-characters-of-a-field/m-p/396705#M115194</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2019-07-15T18:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regex for extracting few characters of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-for-extracting-few-characters-of-a-field/m-p/396706#M115195</link>
      <description>&lt;P&gt;There are many ways.  Here is another one:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=VLAN mode=sed "s/\(.*$//"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval VLAN="vlan(foo)" 
| rex field=VLAN mode=sed "s/\(.*$//"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Jul 2019 20:00:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-for-extracting-few-characters-of-a-field/m-p/396706#M115195</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-15T20:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regex for extracting few characters of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-for-extracting-few-characters-of-a-field/m-p/396707#M115196</link>
      <description>&lt;P&gt;Come back and click &lt;CODE&gt;Accept&lt;/CODE&gt; on the best answer, @surekhasplunk!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 17:09:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-for-extracting-few-characters-of-a-field/m-p/396707#M115196</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-23T17:09:54Z</dc:date>
    </item>
  </channel>
</rss>

