<?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 write regex for filtering values with .,: in same field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216442#M63511</link>
    <description>&lt;P&gt;try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^(?&amp;lt;field&amp;gt;[^:.]*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 30 Dec 2016 13:11:19 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2016-12-30T13:11:19Z</dc:date>
    <item>
      <title>How to write regex for filtering values with .,: in same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216438#M63507</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have below values in same field , i have to take the values(characters) before :  .If the first value is ip address then full ip have to taken.&lt;BR /&gt;
for example ,&lt;/P&gt;

&lt;P&gt;10.102.208.108:sqlexpress( need full ip address from here)&lt;BR /&gt;
ALATDEV1:OMGEO(Need ALATDEV1 from here)&lt;BR /&gt;
SWSYBQ21.dtcc.com:1025 (Need SWSYBQ21 from here )&lt;BR /&gt;
SWTEPQ0004.corp.dtcc.com:172.21.168.62:172.21.168.62:0:ServiceList.WebInspect Data Server (Need SWTEPQ0004)&lt;/P&gt;

&lt;P&gt;Please suggest me .&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 11:09:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216438#M63507</guid>
      <dc:creator>umsundar2015</dc:creator>
      <dc:date>2016-12-30T11:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex for filtering values with .,: in same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216439#M63508</link>
      <description>&lt;P&gt;Hi umsundar2015,&lt;BR /&gt;
Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^(?&amp;lt;field&amp;gt;[^:]*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 11:59:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216439#M63508</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-12-30T11:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex for filtering values with .,: in same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216440#M63509</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2285iBA0689F49A44B18E/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;Hi @umsundar2015,&lt;BR /&gt;
Will it be possible for you to give complete event as example i.e. whether there is a pattern before and pattern after the field you are trying to extract?&lt;/P&gt;

&lt;P&gt;If not can you try Interactive Field Extraction to let Splunk generate regular expression for the required field extraction. In your test machine you can add some sample logs and use Extract New Fields option.&lt;/P&gt;

&lt;P&gt;Refer to attached screenshot for a sample regular expression based IFX.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 12:19:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216440#M63509</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2016-12-30T12:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex for filtering values with .,: in same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216441#M63510</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Thank you  for your rex.&lt;/P&gt;

&lt;P&gt;But still for this  CVSQLP0001.corp.reds.com:MSSQLSERVER , i am getting CVSQLP0001.corp.reds.com&lt;/P&gt;

&lt;P&gt;My requirement is to get CVSQLP0001 for the above scenario too.&lt;/P&gt;

&lt;P&gt;Pls advice me .&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 12:53:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216441#M63510</guid>
      <dc:creator>umsundar2015</dc:creator>
      <dc:date>2016-12-30T12:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex for filtering values with .,: in same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216442#M63511</link>
      <description>&lt;P&gt;try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^(?&amp;lt;field&amp;gt;[^:.]*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 13:11:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216442#M63511</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-12-30T13:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex for filtering values with .,: in same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216443#M63512</link>
      <description>&lt;P&gt;now the ip address is not proper , iam getting 10 alone for 10.102.208.108:SQLEXPRESS,&lt;BR /&gt;
Pls suggest&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 13:46:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216443#M63512</guid>
      <dc:creator>umsundar2015</dc:creator>
      <dc:date>2016-12-30T13:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex for filtering values with .,: in same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216444#M63513</link>
      <description>&lt;P&gt;try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^(?&amp;lt;field&amp;gt;((\d+\.\d+\.\d+\.\d+)|(\w+))*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 14:14:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216444#M63513</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-12-30T14:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex for filtering values with .,: in same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216445#M63514</link>
      <description>&lt;P&gt;This should work for all the cases if say the values are in field called &lt;CODE&gt;testField&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your query to return testField
| rex field=testField "^(?&amp;lt;myField&amp;gt;(([\d\.]+)|(\w+)))[:.]"
| table myField
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://regex101.com/r/k37Bwu/1"&gt;See extraction here.&lt;/A&gt;&lt;BR /&gt;
You can also replace the last capturing group &lt;CODE&gt;[:.]&lt;/CODE&gt; to include comma if required &lt;CODE&gt;[:.,]&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 23:55:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216445#M63514</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-12-30T23:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex for filtering values with .,: in same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216446#M63515</link>
      <description>&lt;P&gt;hi gokandroid,&lt;/P&gt;

&lt;P&gt;Thank you and this works perfectly ..&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2017 11:07:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-for-filtering-values-with-in-same-field/m-p/216446#M63515</guid>
      <dc:creator>umsundar2015</dc:creator>
      <dc:date>2017-01-02T11:07:41Z</dc:date>
    </item>
  </channel>
</rss>

