<?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 Help Needed in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/RegEx-Help-Needed/m-p/480354#M134632</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;to "extract" the device name, please try this regex:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;"\w.+"="(?P&amp;lt;device_name&amp;gt;.+)"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The value will be stored in device_name.&lt;/P&gt;

&lt;P&gt;Here you can test the regex &lt;A href="https://regex101.com/r/LNP0Ia/1"&gt;https://regex101.com/r/LNP0Ia/1&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Sep 2019 15:31:59 GMT</pubDate>
    <dc:creator>manuelostertag</dc:creator>
    <dc:date>2019-09-12T15:31:59Z</dc:date>
    <item>
      <title>RegEx Help Needed</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-Help-Needed/m-p/480353#M134631</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;I'm a complete newbie when it comes to RegEx, but I was wondering if someone could please advise on how I could extract the name of the device from the following string?&lt;/P&gt;

&lt;P&gt;"hostname"="iPhone"&lt;/P&gt;

&lt;P&gt;The syslog I am using has every data point in the same format, I would like to make sure that Splunk correctly identifies the hostname each time. The built-in field extraction tool could recognise the term 'iPhone' but not something like 'DESKTOP-8HGF56' for example. I need it to be 100% every time so perhaps a regex term could let anything between "hostname"="xxxx" be extracted?&lt;/P&gt;

&lt;P&gt;Any advice would be greatly appreciated, thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 14:51:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-Help-Needed/m-p/480353#M134631</guid>
      <dc:creator>danfinan</dc:creator>
      <dc:date>2019-09-12T14:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx Help Needed</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-Help-Needed/m-p/480354#M134632</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;to "extract" the device name, please try this regex:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;"\w.+"="(?P&amp;lt;device_name&amp;gt;.+)"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The value will be stored in device_name.&lt;/P&gt;

&lt;P&gt;Here you can test the regex &lt;A href="https://regex101.com/r/LNP0Ia/1"&gt;https://regex101.com/r/LNP0Ia/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 15:31:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-Help-Needed/m-p/480354#M134632</guid>
      <dc:creator>manuelostertag</dc:creator>
      <dc:date>2019-09-12T15:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx Help Needed</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-Help-Needed/m-p/480355#M134633</link>
      <description>&lt;P&gt;Hi danfinan,&lt;BR /&gt;
try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "\"hostname\"\=\"(?&amp;lt;device_name&amp;gt;[^\"]*)\""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you can test it at &lt;A href="https://regex101.com/r/kQZJQe/1"&gt;https://regex101.com/r/kQZJQe/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 16:39:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-Help-Needed/m-p/480355#M134633</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-09-12T16:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx Help Needed</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-Help-Needed/m-p/480356#M134634</link>
      <description>&lt;P&gt;Giuseppe uses a noteworthy tactic: matching on characters that are NOT something. In this case, matching on characters that are not double quotes. You may find that this is much more reliable that listing out the legal characters or character classes. I use this a lot and it has saved time by making the matching much more reliable.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 17:50:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-Help-Needed/m-p/480356#M134634</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2019-09-12T17:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx Help Needed</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-Help-Needed/m-p/480357#M134635</link>
      <description>&lt;P&gt;Indeed, this regex solution is the better one &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 18:14:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-Help-Needed/m-p/480357#M134635</guid>
      <dc:creator>manuelostertag</dc:creator>
      <dc:date>2019-09-12T18:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx Help Needed</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-Help-Needed/m-p/480358#M134636</link>
      <description>&lt;P&gt;Hi danfinan,&lt;BR /&gt;
if this answer satisfies your need, please accept and/or upvote it.&lt;BR /&gt;
Bye and see next time.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2019 07:07:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-Help-Needed/m-p/480358#M134636</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-09-13T07:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx Help Needed</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-Help-Needed/m-p/480359#M134637</link>
      <description>&lt;P&gt;Giuseppe, you wonderful human - that worked perfectly, exactly what I was looking for. Thank you very much for your help, greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 12:54:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-Help-Needed/m-p/480359#M134637</guid>
      <dc:creator>danfinan</dc:creator>
      <dc:date>2019-09-16T12:54:33Z</dc:date>
    </item>
  </channel>
</rss>

