<?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 edit my REGEX in transforms.conf to allow certain data to get indexed in Splunk? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209657#M61310</link>
    <description>&lt;P&gt;Thanks if it helped, then please accept or upvote the answer.. Updating it in original answer&lt;/P&gt;</description>
    <pubDate>Thu, 03 Nov 2016 19:54:00 GMT</pubDate>
    <dc:creator>gokadroid</dc:creator>
    <dc:date>2016-11-03T19:54:00Z</dc:date>
    <item>
      <title>How to edit my REGEX in transforms.conf to allow certain data to get indexed in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209649#M61302</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a regex to allow certain data into Splunk via a transforms, and now I need to update it. I made some changes, but the data still isn't coming in, so I'm assuming that my regex is wrong.  &lt;/P&gt;

&lt;P&gt;Here's my transforms:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[save_fil_wc_ips_ive_tr0_asr]
REGEX = (?i)^[^|]+\|[^|]+\|[^|]+\|[^|]+\|[^|]+\|[^|]+\|(fil|fidc|wc|tr0|asr|[0-9][0-9[0-9]rtr-1.fmr.com|rtr-2.fmr.com)
DEST_KEY = queue
FORMAT = indexQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here's some sample data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1478196000000|3176866|NormalizedPortInfo|UnknownProtocolPkts|0|Interface|150rtr-1.fmr.com|Gi0/0/0
1478196000000|3176866|NormalizedPortInfo|Bits|1333972272|Interface|150rtr-1.fmr.com|Gi0/0/0
1478196000000|3176866|NormalizedPortInfo|UnicastOut|280872|Interface|150rtr-1.fmr.com|Gi0/0/0
1478196000000|3176866|NormalizedPortInfo|ErrorsIn|0|Interface|150rtr-1.fmr.com|Gi0/0/0
1478196000000|3176866|NormalizedPortInfo|AdminStatusPollable|1|Interface|150rtr-1.fmr.com|Gi0/0/0
1478196000000|3176866|NormalizedPortInfo|FrameSize|292.6625456115502|Interface|150rtr-1.fmr.com|Gi0/0/0
1478196000000|3176866|NormalizedPortInfo|SpeedIn|30000000|Interface|150rtr-1.fmr.com|Gi0/0/0
1478196000000|3176866|NormalizedPortInfo|BitsOut|327007456|Interface|150rtr-1.fmr.com|Gi0/0/0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Nov 2016 18:04:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209649#M61302</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2016-11-03T18:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my REGEX in transforms.conf to allow certain data to get indexed in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209650#M61303</link>
      <description>&lt;P&gt;You can use below regex at search time, or while field extraction to get all the fields and once done you can then extract any sub info if needed:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yourBasaeQuery to search rtr-1.fmr.com
| rex "^(?&amp;lt;id1&amp;gt;[^\|]+)\|(?&amp;lt;id12&amp;gt;[^\|]+)\|(?&amp;lt;portInfo&amp;gt;[^\|]+)\|(?&amp;lt;protocolInfo&amp;gt;[^\|]+)\|(?&amp;lt;bytes&amp;gt;[^\|]+)\|(?&amp;lt;interface&amp;gt;[^\|]+)\|(?&amp;lt;dotCom&amp;gt;[^\|]+)\|(?&amp;lt;gi0&amp;gt;[^\s]+)"
| complete your query
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;remane the id1, id2 and all other field names according to your convenience.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://regex101.com/r/hnzZLh/1"&gt;See here&lt;/A&gt; the results.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Updating as per comments&lt;/STRONG&gt;&lt;BR /&gt;
Escape any of the special characters like dots in hostname &lt;CODE&gt;\.&lt;/CODE&gt; which might be missing and close off the regex with a &lt;CODE&gt;\|.*&lt;/CODE&gt; in the end if required.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 18:22:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209650#M61303</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-11-03T18:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my REGEX in transforms.conf to allow certain data to get indexed in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209651#M61304</link>
      <description>&lt;P&gt;This is for filtering out data to get to Splunk, so I can't do it at search time.  &lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 18:26:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209651#M61304</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2016-11-03T18:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my REGEX in transforms.conf to allow certain data to get indexed in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209652#M61305</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;for the making of new regular expressions I personally love to use the following site. &lt;BR /&gt;
&lt;A href="https://regex101.com/"&gt;https://regex101.com/&lt;/A&gt;&lt;BR /&gt;
It has the possibility to even debug the regular expression at every step.&lt;/P&gt;

&lt;P&gt;Try the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?i)(?:[^|]+\|[^|]+\|[^|]+\|[^|]+\|[^|]+\|[^|]+\|)(\d{3,}\w{3,}\-\d\.\w{3,}\.\w+)(?:\|.*)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Nov 2016 18:29:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209652#M61305</guid>
      <dc:creator>horsefez</dc:creator>
      <dc:date>2016-11-03T18:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my REGEX in transforms.conf to allow certain data to get indexed in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209653#M61306</link>
      <description>&lt;P&gt;use the similar regex...in your regex you are extracting only 6 elements whereas your data has 8 elements..can you try to put a &lt;CODE&gt;.*&lt;/CODE&gt; in the end to allow the remaining fields and see if that works, or extract all 8 fields via regex to match to data coming.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 18:35:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209653#M61306</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-11-03T18:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my REGEX in transforms.conf to allow certain data to get indexed in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209654#M61307</link>
      <description>&lt;P&gt;The issue isn't the fields, it's the last set of regexes.  If I take out the .fmr.com options, (last 2), it works fine for those elements.  I think the problem is with the ".fmr.com" regexes.  &lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 18:42:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209654#M61307</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2016-11-03T18:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my REGEX in transforms.conf to allow certain data to get indexed in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209655#M61308</link>
      <description>&lt;P&gt;use &lt;CODE&gt;\.&lt;/CODE&gt; to escape your dots. Maybe thatts whats putting it off as dot is a special charater in regex. and try to close off that regex with a pipe after your round bracket grouping &lt;CODE&gt;(fil|fidc|wc|tr0|asr|[0-9][0-9[0-9]rtr-1.fmr.com|rtr-2.fmr.com)\|&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 18:44:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209655#M61308</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-11-03T18:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my REGEX in transforms.conf to allow certain data to get indexed in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209656#M61309</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;got it - (?i)^[^|]+\|[^|]+\|[^|]+\|[^|]+\|[^|]+\|[^|]+\|(fil|fidc|wc|tr0|asr|[0-9]*rtr-1\.fmr\.com|[0-9]*rtr-2\.fmr\.com)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Nov 2016 19:44:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209656#M61309</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2016-11-03T19:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my REGEX in transforms.conf to allow certain data to get indexed in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209657#M61310</link>
      <description>&lt;P&gt;Thanks if it helped, then please accept or upvote the answer.. Updating it in original answer&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 19:54:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209657#M61310</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-11-03T19:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my REGEX in transforms.conf to allow certain data to get indexed in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209658#M61311</link>
      <description>&lt;P&gt;Spot on @gokadroid! I want to highlight for any padawans that in the original &lt;CODE&gt;[^|]+\|&lt;/CODE&gt; was used. But notice how the first match says anything that is not a pipe - but in reality, that pipe is not escaped and could mean anything that is not nothing OR nothing (I guess? I'm not really sure what happens there). The point is, the pipe is not escaped in the brackets, but then escaped after. So I agree about escaping it both times. Huzzah.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 12:21:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209658#M61311</guid>
      <dc:creator>sloshburch</dc:creator>
      <dc:date>2016-11-04T12:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my REGEX in transforms.conf to allow certain data to get indexed in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209659#M61312</link>
      <description>&lt;P&gt;I forget the exact syntax, but you should be able to say &lt;CODE&gt;[^|]+\|&lt;/CODE&gt; several times with some regex syntax - rather than having to explicitly list them (which is more typo prone). If anyone recalls what that is, or what terms to search for to learn it, please do shout.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 12:23:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-REGEX-in-transforms-conf-to-allow-certain-data-to/m-p/209659#M61312</guid>
      <dc:creator>sloshburch</dc:creator>
      <dc:date>2016-11-04T12:23:34Z</dc:date>
    </item>
  </channel>
</rss>

