<?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 do you use rex to extract a specific field in Splunk? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-rex-to-extract-a-specific-field-in-Splunk/m-p/455097#M128736</link>
    <description>&lt;P&gt;Something like this should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=Custom_Tag "\"Account\",\s+\"Value\":\s+\"(?&amp;lt;Tag_Account&amp;gt;[^\"]+)"
| rex field=Custom_Tag "\"AssetOwner\",\s+\"Value\":\s+\"(?&amp;lt;Tag_AssetOwner&amp;gt;[^\"]+)"
| rex field=Custom_Tag "\"AssetDataStored\",\s+\"Value\":\s+\"(?&amp;lt;Tag_AssetDataStored&amp;gt;[^\"]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 22 Mar 2019 15:55:34 GMT</pubDate>
    <dc:creator>FrankVl</dc:creator>
    <dc:date>2019-03-22T15:55:34Z</dc:date>
    <item>
      <title>How do you use rex to extract a specific field in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-rex-to-extract-a-specific-field-in-Splunk/m-p/455096#M128735</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Can anybody help me extracting from this table with 3 regular expression:&lt;/P&gt;

&lt;P&gt;I got a column in Splunk like this and the values between&lt;/P&gt;

&lt;P&gt;Custom_Tag (this is the column name which i need to be split into 3 columns Account,AssetOwner,AssetDataStored)&lt;BR /&gt;
"Key": "Account", "Value": "037395386785"&lt;BR /&gt;
"Key": "AssetOwner", "Value": "Infrastructure"&lt;BR /&gt;
"Key": "AssetDataStored", "Value": "InternalUseOnly"&lt;BR /&gt;
"Key": "Account", "Value": "343254354354"&lt;BR /&gt;
"Key": "AssetOwner", "Value": "Production"&lt;BR /&gt;
"Key": "AssetDataStored", "Value": "ExternalUse"&lt;/P&gt;

&lt;P&gt;and i need a &lt;CODE&gt;rex&lt;/CODE&gt; to extract the values into 3 columns when matching the word Account,AssetOwner,AssedDataStored&lt;/P&gt;

&lt;P&gt;Tag_Account                               Tag_AssetOwner                           Tag_AssetDataStored&lt;BR /&gt;
037395386785                            Infrastructure                               InternalUseOnly&lt;BR /&gt;
343254354354                            Production                                    ExternalUse&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:48:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-rex-to-extract-a-specific-field-in-Splunk/m-p/455096#M128735</guid>
      <dc:creator>braicu</dc:creator>
      <dc:date>2020-09-29T23:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use rex to extract a specific field in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-rex-to-extract-a-specific-field-in-Splunk/m-p/455097#M128736</link>
      <description>&lt;P&gt;Something like this should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=Custom_Tag "\"Account\",\s+\"Value\":\s+\"(?&amp;lt;Tag_Account&amp;gt;[^\"]+)"
| rex field=Custom_Tag "\"AssetOwner\",\s+\"Value\":\s+\"(?&amp;lt;Tag_AssetOwner&amp;gt;[^\"]+)"
| rex field=Custom_Tag "\"AssetDataStored\",\s+\"Value\":\s+\"(?&amp;lt;Tag_AssetDataStored&amp;gt;[^\"]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Mar 2019 15:55:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-rex-to-extract-a-specific-field-in-Splunk/m-p/455097#M128736</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-03-22T15:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use rex to extract a specific field in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-rex-to-extract-a-specific-field-in-Splunk/m-p/455098#M128737</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Give a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval Custom_Tag ="\"Key\": \"Account\", \"Value\": \"037395386785\"" 
| append 
    [| makeresults 
    | eval Custom_Tag ="\"Key\": \"AssetOwner\", \"Value\": \"Infrastructure\""] 
| append 
    [| makeresults 
    | eval Custom_Tag ="\"Key\": \"AssetDataStored\", \"Value\": \"InternalUseOnly\""] 
| append 
    [| makeresults 
    | eval Custom_Tag ="\"Key\": \"Account\", \"Value\": \"343254354354\""] 
| append 
    [| makeresults 
    | eval Custom_Tag ="\"Key\": \"AssetOwner\", \"Value\": \"Production\""] 
| append 
    [| makeresults 
    | eval Custom_Tag ="\"Key\": \"AssetDataStored\", \"Value\": \"ExternalUse\""] 
| eval temp = replace(Custom_Tag , "\"|:|Key|Value","") 
| makemv delim="," temp 
| eval column1 = ltrim(mvindex(temp,0)) 
| eval column2=ltrim(mvindex(temp,1)) 
| eval{column1}=column2 
| stats list(Account) as Tag_Account,list(AssetDataStored) as Tag_AssetDataStored,list(AssetOwner) as Tag_AssetOwner
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Mar 2019 18:19:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-rex-to-extract-a-specific-field-in-Splunk/m-p/455098#M128737</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-03-22T18:19:09Z</dc:date>
    </item>
  </channel>
</rss>

