<?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: regex question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/468968#M132019</link>
    <description>&lt;P&gt;Hi @nathanluke86,&lt;BR /&gt;
you could use something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=your_index 
| rex max_match=0 "\b(?&amp;lt;your_id&amp;gt;\d{10})\b"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Mon, 06 Apr 2020 13:22:02 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2020-04-06T13:22:02Z</dc:date>
    <item>
      <title>regex question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/468964#M132015</link>
      <description>&lt;P&gt;I am trying to get exactly 10 digits which might be between white spaces or symbols etc:&lt;/P&gt;

&lt;P&gt;1234567890 &lt;BR /&gt;
,234567890 , 1234567890&lt;BR /&gt;
:1234567890&lt;/P&gt;

&lt;P&gt;etc etc&lt;/P&gt;

&lt;P&gt;but not 10 digits from a string of 11+ digits etc&lt;/P&gt;

&lt;P&gt;There are  no unique digits within these 10 digit ID's I am trying to identify. I am just trying to get as close as possible without generating to many false positives&lt;/P&gt;

&lt;P&gt;TIA&lt;/P&gt;

&lt;P&gt;TIA&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 12:32:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/468964#M132015</guid>
      <dc:creator>nathanluke86</dc:creator>
      <dc:date>2020-04-06T12:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: regex question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/468965#M132016</link>
      <description>&lt;P&gt;Hi @nathanluke86,&lt;BR /&gt;
could you share an example of your logs?&lt;BR /&gt;
Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 12:36:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/468965#M132016</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-04-06T12:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: regex question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/468966#M132017</link>
      <description>&lt;P&gt;@gcusello &lt;/P&gt;

&lt;P&gt;I don't have specific logs to search. I just need to search all indexes index=* for exactly 10 digit strings that are between white spaces or symbols as above&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 12:45:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/468966#M132017</guid>
      <dc:creator>nathanluke86</dc:creator>
      <dc:date>2020-04-06T12:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: regex question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/468967#M132018</link>
      <description>&lt;P&gt;Hi @nathanluke86,&lt;/P&gt;

&lt;P&gt;Assuming I fully understood your requirements, the following SPL should do the trick:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex max_match=0 "\b(?&amp;lt;id&amp;gt;\d{10})\b"
| mvexpand id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Max match will capture any occurrences of 10 digits in you event and place the values into a multivalued field named id. You can then expand id if you want those multivalue fields to be displayed individually or just leave them as they are.&lt;/P&gt;

&lt;P&gt;Hope that makes sense.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
J&lt;/P&gt;

&lt;P&gt;Edited: fixing a typo on the regex as I couldn't test this on a Splunk instance&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 13:06:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/468967#M132018</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2020-04-06T13:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: regex question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/468968#M132019</link>
      <description>&lt;P&gt;Hi @nathanluke86,&lt;BR /&gt;
you could use something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=your_index 
| rex max_match=0 "\b(?&amp;lt;your_id&amp;gt;\d{10})\b"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 13:22:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/468968#M132019</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-04-06T13:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: regex question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/468969#M132020</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=yours
| regex "\b\d{10})\b"
| rex max_match=0 "\b(?&amp;lt;id&amp;gt;\d{10})\b"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;at first, search what you want.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 20:09:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/468969#M132020</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-06T20:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: regex question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/468970#M132021</link>
      <description>&lt;P&gt;Hi @nathanluke86, don't forget to accept one of the answers if your problem is now solved.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 08:59:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/468970#M132021</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2020-04-08T08:59:36Z</dc:date>
    </item>
  </channel>
</rss>

