<?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: Regular Expression in Search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79693#M20165</link>
    <description>&lt;P&gt;regex attack_id="30(40|57|54)"&lt;/P&gt;</description>
    <pubDate>Mon, 16 May 2016 11:20:30 GMT</pubDate>
    <dc:creator>ovetjornhed</dc:creator>
    <dc:date>2016-05-16T11:20:30Z</dc:date>
    <item>
      <title>Regular Expression in Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79687#M20159</link>
      <description>&lt;P&gt;I currently have a search looking for specific attack_id values.  For example:&lt;/P&gt;

&lt;P&gt;("attack_id=3040" OR "attack_id=3057" OR "attack_id=3054")&lt;/P&gt;

&lt;P&gt;My question is, how could I create a regular expression that could cut this down so that I would only need to enter the test attack_id= once followed by a series of numbers such as 3040 3057 3054 etc and have the search trigger on a combination of attack_id= and one of the numbers.&lt;/P&gt;

&lt;P&gt;For those who are familiar, just like egrep in unix.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:52:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79687#M20159</guid>
      <dc:creator>balcv</dc:creator>
      <dc:date>2020-09-28T14:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression in Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79688#M20160</link>
      <description>&lt;P&gt;No, you cannot write &lt;CODE&gt;attack_id = (1231 OR 1231 OR 23421)&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;Have you looked at the &lt;CODE&gt;regex&lt;/CODE&gt; command to filter out events?&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.5/SearchReference/Regex" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.5/SearchReference/Regex&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;P&gt;For a more static classifictaion, make use of the eventtype feature in Splunk, where you can define this as 'attack_type_a', and then search for eventtype=attack_type_a&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;K&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:52:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79688#M20160</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2020-09-28T14:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression in Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79689#M20161</link>
      <description>&lt;P&gt;Perfect. A regex was exactly what I needed.  The solution was a search like this:&lt;/P&gt;

&lt;P&gt;host="myhost.com" | regex attack_id="3040|3054|3048|32708"&lt;/P&gt;

&lt;P&gt;Worked a treat. Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2013 05:46:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79689#M20161</guid>
      <dc:creator>balcv</dc:creator>
      <dc:date>2013-10-02T05:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression in Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79690#M20162</link>
      <description>&lt;P&gt;Is it possible to use regex before the first pipe ? I want to  filter out the events before hand itself, so that it might increase the performance of the query&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 10:23:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79690#M20162</guid>
      <dc:creator>Bireswar</dc:creator>
      <dc:date>2016-01-14T10:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression in Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79691#M20163</link>
      <description>&lt;P&gt;Bireswar,&lt;/P&gt;

&lt;P&gt;You can add your extraction at props.conf allowing you to use it on your main search before the first pipe, like this.&lt;/P&gt;

&lt;P&gt;Lets say you have already extracted a field called "attackers".&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=your_index sourcetype=l33t attackers=* | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Jan 2016 12:31:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79691#M20163</guid>
      <dc:creator>alemarzu</dc:creator>
      <dc:date>2016-01-14T12:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression in Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79692#M20164</link>
      <description>&lt;P&gt;OK but the "props.conf" is not something convenient.&lt;BR /&gt;
If I want to filter out all traffic coming from my legit sites :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&lt;A href="http://a.b.com" target="test_blank"&gt;http://a.b.com&lt;/A&gt; OR &lt;A href="https://a.b.com" target="test_blank"&gt;https://a.b.com&lt;/A&gt; OR &lt;A href="http://mobile.a.b.com" target="test_blank"&gt;http://mobile.a.b.com&lt;/A&gt; OR &lt;A href="https://mobile.a.b.com" target="test_blank"&gt;https://mobile.a.b.com&lt;/A&gt; OR &lt;A href="http://a.b.com" target="test_blank"&gt;http://a.b.com&lt;/A&gt;. OR &lt;A href="https://a.b.com" target="test_blank"&gt;https://a.b.com&lt;/A&gt;. OR &lt;A href="http://app1.a.b.com" target="test_blank"&gt;http://app1.a.b.com&lt;/A&gt; OR &lt;A href="https://app1.a.b.com" target="test_blank"&gt;https://app1.a.b.com&lt;/A&gt; OR &lt;A href="http://app2.a.b.com" target="test_blank"&gt;http://app2.a.b.com&lt;/A&gt; OR &lt;A href="https://app2.a.b.com" target="test_blank"&gt;https://app2.a.b.com&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is how I currently do ... it would be more efficient to do so with REGEX "in" the filtering of the referer directly (in my case) !&lt;/P&gt;

&lt;P&gt;\T,&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2016 08:18:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79692#M20164</guid>
      <dc:creator>tsmets</dc:creator>
      <dc:date>2016-04-07T08:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression in Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79693#M20165</link>
      <description>&lt;P&gt;regex attack_id="30(40|57|54)"&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 11:20:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79693#M20165</guid>
      <dc:creator>ovetjornhed</dc:creator>
      <dc:date>2016-05-16T11:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression in Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79694#M20166</link>
      <description>&lt;P&gt;When newer version of Splunk you can use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;attack_id IN (1231 1231 23421)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;attack_id IN (1231,1231,23421)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 May 2019 05:16:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79694#M20166</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2019-05-16T05:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression in Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79695#M20167</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Could someone please help me to filter this raw fields and extract it from a new field? I just need to gather "DUMP is complete" and convert it to a new field which is dump_status. &lt;/P&gt;

&lt;P&gt;Backup Server: 4.165.1.2: Using numzones of 3 for device /sybase//log_archives/ECP_trans_2019-07-19T15_15_01.dmp.&lt;BR /&gt;
Backup Server: 4.165.1.3: Using archcnt of 1 for device /sybase//log_archives/ECP_trans_2019-07-19T15_15_01.dmp.&lt;BR /&gt;
Backup Server: 4.165.1.4: Using dbdevcnt of 2 for device /sybase//log_archives/ECP_trans_2019-07-19T15_15_01.dmp.&lt;BR /&gt;
Backup Server: 4.166.1.4: Using pagesize of 16384 bytes for device /sybase//log_archives/ECP_trans_2019-07-19T15_15_01.dmp.&lt;BR /&gt;
Backup Server: 4.58.1.1: Database ECP: 34414 kilobytes DUMPED.&lt;BR /&gt;
Backup Server: 3.43.1.1: Dump phase number 3 completed.&lt;BR /&gt;
Backup Server: 4.58.1.1: Database ECP: 34436 kilobytes DUMPED.&lt;BR /&gt;
Backup Server: 3.42.1.1: DUMP is complete (database ECP).&lt;BR /&gt;
(return status = 0)&lt;BR /&gt;
completed&lt;/P&gt;

&lt;P&gt;Thank you! &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:21:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/79695#M20167</guid>
      <dc:creator>kevinalzaga</dc:creator>
      <dc:date>2020-09-30T01:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression in Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/536426#M151668</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;We want to do a field extraction where we need to eliminate comma from the field value. E.g. we get the log as ......number = 524,361....... and what we need is the number to be extracted as "number = 524361" (the comma is removed in the output). Is there a way to do it using regex may be with some function or something. Or any other way to achieve it. Appreciate your response in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 04:59:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/536426#M151668</guid>
      <dc:creator>manish_578</dc:creator>
      <dc:date>2021-01-20T04:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression in Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/536429#M151669</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/222537"&gt;@manish_578&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;If you want to clear comma on search you can use replace command like below;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval number =replace(number,",","")&lt;/LI-CODE&gt;&lt;P&gt;Or if you want &amp;nbsp;put this into extractions, you should but below EVAL inside your sourcetype settings;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[your_sourcetype]
EVAL-number = replace(number,",","")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you an upvote is appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 05:22:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/536429#M151669</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-01-20T05:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression in Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/536438#M151674</link>
      <description>&lt;P&gt;Yes, this is good for search but how to use for field extraction and in regex directly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 06:37:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-in-Search/m-p/536438#M151674</guid>
      <dc:creator>manish_578</dc:creator>
      <dc:date>2021-01-20T06:37:13Z</dc:date>
    </item>
  </channel>
</rss>

