<?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 filter for a specific pattern with wild card? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321921#M60011</link>
    <description>&lt;P&gt;If you deem a posted answer as valid and helpful to your solving of the issue, please accept said answer so that this question no longer appears open.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Apr 2018 16:39:11 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2018-04-06T16:39:11Z</dc:date>
    <item>
      <title>How to filter for a specific pattern with wild card?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321912#M60002</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;In excel you can custom filter the cells using a wild card with a question mark. &lt;BR /&gt;
For example, if I want to filter following data I will write &lt;STRONG&gt;AB??-&lt;/STRONG&gt; &lt;BR /&gt;
&lt;STRONG&gt;AB22-&lt;/STRONG&gt; , &lt;STRONG&gt;AB43-&lt;/STRONG&gt;, &lt;STRONG&gt;AB03-&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;Are these searches possible in Splunk? If I write AB*-  , it will match AB1233-, ABw-, AB22222222-. &lt;/P&gt;

&lt;P&gt;I want specifically 2 characters between &lt;STRONG&gt;AB&lt;/STRONG&gt; and &lt;STRONG&gt;-&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 21:25:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321912#M60002</guid>
      <dc:creator>aamer4zangi</dc:creator>
      <dc:date>2018-04-05T21:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter for a specific pattern with wild card?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321913#M60003</link>
      <description>&lt;P&gt;write add below  rex to your query&lt;/P&gt;

&lt;P&gt;| rex "AB(?\d\d)-" | eval myfield="AB".myfield |  search myfield=*&lt;/P&gt;

&lt;P&gt;please let me know if its works?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 22:23:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321913#M60003</guid>
      <dc:creator>sravankaripe</dc:creator>
      <dc:date>2018-04-05T22:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter for a specific pattern with wild card?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321914#M60004</link>
      <description>&lt;P&gt;Try this run anywhere search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval raw="AB22-,AB43-,AB03-,AB1233-,ABw-,AB22222222-"| makemv raw delim="," | mvexpand raw| rex field=raw "(?&amp;lt;newfield&amp;gt;AB\d{2}-)"| search newfield=*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In your environment, you should write&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your  base search &amp;gt;| rex field=_raw "(?&amp;lt;newfield&amp;gt;AB\d{2}-)"| search newfield=*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If these are getting capture in a specific field the write &lt;CODE&gt;field=&amp;lt;your_field&amp;gt;&lt;/CODE&gt; in &lt;CODE&gt;rex&lt;/CODE&gt; command or else &lt;CODE&gt;_raw&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 05:56:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321914#M60004</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-04-06T05:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter for a specific pattern with wild card?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321915#M60005</link>
      <description>&lt;P&gt;Thanks in advance. I got the following error.&lt;/P&gt;

&lt;P&gt;Error in 'rex' command: Encountered the following error while compiling the regex 'AB(?\d\d)-': Regex: unrecognized character after (? or (?-&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 15:44:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321915#M60005</guid>
      <dc:creator>aamer4zangi</dc:creator>
      <dc:date>2018-04-06T15:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter for a specific pattern with wild card?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321916#M60006</link>
      <description>&lt;P&gt;did you try this?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 15:55:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321916#M60006</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-04-06T15:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter for a specific pattern with wild card?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321917#M60007</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;BR /&gt;
I must confess I am encountering makeresults for the first time, so trying to wrap my head around the search cmd.&lt;/P&gt;

&lt;P&gt;AB22-,AB43-,AB03-,AB1233-,ABw-,AB22222222-  is not my raw data, it was just an example. The cells contain data with a pattern of &lt;STRONG&gt;ABXX-&lt;/STRONG&gt; and I want to filter only those records in a specific column which follow that specific pattern.&lt;/P&gt;

&lt;P&gt;I did come across filter option when converting data into Data Table. However, still no success.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 15:58:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321917#M60007</guid>
      <dc:creator>aamer4zangi</dc:creator>
      <dc:date>2018-04-06T15:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter for a specific pattern with wild card?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321918#M60008</link>
      <description>&lt;P&gt;did you try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=&amp;lt;your_index&amp;gt;| rex field=_raw "(?&amp;lt;newfield&amp;gt;AB\d{2}-)"| search newfield=*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;can you share sample raw events so that I can give you appropriate regex?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 16:01:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321918#M60008</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-04-06T16:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter for a specific pattern with wild card?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321919#M60009</link>
      <description>&lt;P&gt;There are thousands of lines, just sampling few lines. This data is coming from comments people write for specific hardware and is not generated by a machine. Thus, it is highly random.  The raw data is as follows. Additionally this data is present in a specific column.&lt;/P&gt;

&lt;H2&gt;After the search the first 6 rows should be the final result.&lt;/H2&gt;

&lt;P&gt;1   1401812.AQWEAB02-TCPL02.1G&lt;BR /&gt;
2   1356292.QWERAB04-ANCA02&lt;BR /&gt;
3   1234OAB05-PLAIN02 reserved ||&lt;BR /&gt;
4   1405252.AB07-SBCC01&lt;BR /&gt;
5   1409325-ARDRAB05-GENIV02.22&lt;BR /&gt;
6   1304030.ARDRAB07-TECEL02.10333&lt;BR /&gt;
7   1389621.ABFDBC01-COGDS02333&lt;BR /&gt;
8   1349222.ABFDBC01-MOH29.5MJJ&lt;BR /&gt;
9   1313513.ABFDBC01-BPRSS&lt;BR /&gt;
10  1393599.ABFDBC01-WGELP&lt;BR /&gt;
11  1375957.ABFDBC01-BREQL01.0M222&lt;BR /&gt;
12  1332348.ABFDBC01-MANNG01.10M1WW1&lt;/P&gt;

&lt;H2&gt;13  1321017.ABFDBC01-BLJCW01.3MQQ&lt;/H2&gt;

&lt;P&gt;Moreover, it is not only &lt;STRONG&gt;AB??-&lt;/STRONG&gt; that I would be searching for, there are other criteria as well but I guess if we can get one criteria down then others should follow the same pattern.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 16:16:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321919#M60009</guid>
      <dc:creator>aamer4zangi</dc:creator>
      <dc:date>2018-04-06T16:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter for a specific pattern with wild card?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321920#M60010</link>
      <description>&lt;P&gt;yes so I have given the correct regex &lt;BR /&gt;
what is the result of this search?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=&amp;lt;your_index&amp;gt;| rex field=_raw "(?&amp;lt;newfield&amp;gt;AB\d{2}-)"| search newfield=*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have already given you the solution.&lt;BR /&gt;
See my workaround here. it is exactly matching first 6 events.  above search will return  only events with &lt;CODE&gt;AB??-&lt;/CODE&gt;.&lt;BR /&gt;
&lt;A href="https://regex101.com/r/7b6mTh/1"&gt;https://regex101.com/r/7b6mTh/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 16:36:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321920#M60010</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-04-06T16:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter for a specific pattern with wild card?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321921#M60011</link>
      <description>&lt;P&gt;If you deem a posted answer as valid and helpful to your solving of the issue, please accept said answer so that this question no longer appears open.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 16:39:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321921#M60011</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-04-06T16:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter for a specific pattern with wild card?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321922#M60012</link>
      <description>&lt;P&gt;Thanks a lot mate. Yes, it worked as wanted. In the end if I want to add &lt;STRONG&gt;BC??-&lt;/STRONG&gt; to &lt;STRONG&gt;AB??-&lt;/STRONG&gt; how should I add these two.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 16:57:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321922#M60012</guid>
      <dc:creator>aamer4zangi</dc:creator>
      <dc:date>2018-04-06T16:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter for a specific pattern with wild card?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321923#M60013</link>
      <description>&lt;P&gt;do you mean &lt;CODE&gt;(AB OR BC)??-&lt;/CODE&gt;?&lt;BR /&gt;
then try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;newfield&amp;gt;((AB)|(BC))\d{2}-)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Apr 2018 17:07:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321923#M60013</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-04-06T17:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter for a specific pattern with wild card?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321924#M60014</link>
      <description>&lt;P&gt;Thanks again...yes. It did the trick.&lt;/P&gt;

&lt;P&gt;Moreover, regex101.com is a great tool. &lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 17:18:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-for-a-specific-pattern-with-wild-card/m-p/321924#M60014</guid>
      <dc:creator>aamer4zangi</dc:creator>
      <dc:date>2018-04-06T17:18:30Z</dc:date>
    </item>
  </channel>
</rss>

