<?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 creat named field with regular expression in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-creat-named-field-with-regular-expression/m-p/472677#M133019</link>
    <description>&lt;P&gt;Hi  dabroma5,&lt;BR /&gt;
is this question a duplicate of &lt;A href="https://answers.splunk.com/answers/780044/how-to-creat-named-fiels-with-regular-expression.html?childToView=780356#answer-780356"&gt;https://answers.splunk.com/answers/780044/how-to-creat-named-fiels-with-regular-expression.html?childToView=780356#answer-780356&lt;/A&gt; or it's a different one?&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Thu, 31 Oct 2019 11:58:45 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2019-10-31T11:58:45Z</dc:date>
    <item>
      <title>How to creat named field with regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-creat-named-field-with-regular-expression/m-p/472675#M133017</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;I would like to create a named field to filter Ethernet port numbers. My expression:&lt;BR /&gt;
\beth\d*(?:-\d+)*(?:/\d+(?:.\d+)?)?\b&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:46:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-creat-named-field-with-regular-expression/m-p/472675#M133017</guid>
      <dc:creator>dabroma5</dc:creator>
      <dc:date>2020-09-30T02:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat named field with regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-creat-named-field-with-regular-expression/m-p/472676#M133018</link>
      <description>&lt;P&gt;Within SPL? Like this  &lt;CODE&gt;(?&amp;lt;named_field&amp;gt;regex)&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;In your example&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field="your base field" "\beth\d*(?&amp;lt;field1&amp;gt;-\d+)*(?&amp;lt;field2&amp;gt;/\d+(?&amp;lt;field3&amp;gt;.\d+)?)?\b"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Oct 2019 11:51:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-creat-named-field-with-regular-expression/m-p/472676#M133018</guid>
      <dc:creator>arjunpkishore5</dc:creator>
      <dc:date>2019-10-31T11:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat named field with regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-creat-named-field-with-regular-expression/m-p/472677#M133019</link>
      <description>&lt;P&gt;Hi  dabroma5,&lt;BR /&gt;
is this question a duplicate of &lt;A href="https://answers.splunk.com/answers/780044/how-to-creat-named-fiels-with-regular-expression.html?childToView=780356#answer-780356"&gt;https://answers.splunk.com/answers/780044/how-to-creat-named-fiels-with-regular-expression.html?childToView=780356#answer-780356&lt;/A&gt; or it's a different one?&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 11:58:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-creat-named-field-with-regular-expression/m-p/472677#M133019</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-10-31T11:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat named field with regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-creat-named-field-with-regular-expression/m-p/472678#M133020</link>
      <description>&lt;P&gt;I seems that I wasn't enough specific. &lt;/P&gt;

&lt;P&gt;Below is part of my log:&lt;/P&gt;

&lt;P&gt;"info":{"seqno":0,"evtType":1,"oTime":null,"links":null,"id":"9b0ae9a9-e424-11e9-a309-fd988b74a8c5","origin":null,"relations":[],"details":"","severity":5,"time":1569918148265,"headId":"9b0ae9a9-e424-11e9-a309-fd988b74a8c5","sa":2},"desc":{"alertId":{"desc":"The network port is down","label":"Link down"},"pointId":[{"desc":"Type: openflow\nIP: a.b.c.d","label":"device_name [a.b.c.d]"},{"desc":"","label":""},{"desc":"Network Interfaces","label":""},{"desc":"","label":"eth-0-36"}]},"id":{"alertId":"16","component":1,"pointId":["a-b-c-d","dev","1","36"]}}&lt;/P&gt;

&lt;P&gt;I would like to extract &lt;STRONG&gt;eth-0-36&lt;/STRONG&gt;, but port notation can be different depends on the device:&lt;BR /&gt;
&lt;STRONG&gt;Eth1/1.2; Eth1/2.500; eth-0-19/4; eth-0-4; Eth1/4&lt;/STRONG&gt;&lt;BR /&gt;
and create a field to present data in a table&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 12:01:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-creat-named-field-with-regular-expression/m-p/472678#M133020</guid>
      <dc:creator>dabroma5</dc:creator>
      <dc:date>2019-10-31T12:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat named field with regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-creat-named-field-with-regular-expression/m-p/472679#M133021</link>
      <description>&lt;P&gt;yes, it's the same, my question stuck in the moderation process&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 12:02:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-creat-named-field-with-regular-expression/m-p/472679#M133021</guid>
      <dc:creator>dabroma5</dc:creator>
      <dc:date>2019-10-31T12:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to creat named field with regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-creat-named-field-with-regular-expression/m-p/472680#M133022</link>
      <description>&lt;P&gt;Hi dabroma5,&lt;BR /&gt;
Try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex "\"label\":\"(?&amp;lt;port&amp;gt;(Eth|eth)[^\"]*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;that you can test at &lt;A href="https://regex101.com/r/nE5Zjt/2"&gt;https://regex101.com/r/nE5Zjt/2&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 14:40:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-creat-named-field-with-regular-expression/m-p/472680#M133022</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-10-31T14:40:55Z</dc:date>
    </item>
  </channel>
</rss>

