<?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 extract keywords and associated values with rex from raw logs and display data in a table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-keywords-and-associated-values-with-rex-from-raw/m-p/147149#M41132</link>
    <description>&lt;P&gt;Thank you.. I tried, its just reading all SSN keyword(considering false positive) not extracting the values and listing out.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Feb 2015 19:02:35 GMT</pubDate>
    <dc:creator>satya2p</dc:creator>
    <dc:date>2015-02-19T19:02:35Z</dc:date>
    <item>
      <title>How to extract keywords and associated values with rex from raw logs and display data in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-keywords-and-associated-values-with-rex-from-raw/m-p/147147#M41130</link>
      <description>&lt;P&gt;I have a request input output logged by various sourcetypes in XML and other similar below format. I tried multiple options to extract exact keywords and associated values to display in a table, but I have been unable to do so. Please help.&lt;/P&gt;

&lt;P&gt;Sample Data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Somecontent.ssn=XXXXXXXXX.Somecontent.SomeOthercontent
in XML: &amp;lt;SSN&amp;gt; XXXXXXXXX &amp;lt;/SSN&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Options Tried:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "SSN=(?P\d\d\d-?\d\d-?\d\d\d\d)" | stats count by SSN
| rex field=_raw=\W+SSN "(?\w+)" | stats count by SSN
| rex field=_raw "SSN\=(?\d{9})+"| stats count by SSN
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Feb 2015 16:28:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-keywords-and-associated-values-with-rex-from-raw/m-p/147147#M41130</guid>
      <dc:creator>satya2p</dc:creator>
      <dc:date>2015-02-19T16:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract keywords and associated values with rex from raw logs and display data in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-keywords-and-associated-values-with-rex-from-raw/m-p/147148#M41131</link>
      <description>&lt;P&gt;Your rex commands are not extracting fields.  Therefore, there is nothing for downstream commands to work with.  Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "SSN\&amp;gt;\s*(?P&amp;lt;SSN&amp;gt;\d{9})" | stats count by SSN
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first "SSN" is an eyecatcher to help rex find the right data in your XML.  The second "SSN" is a field name which can be used by the stats command.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Feb 2015 18:29:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-keywords-and-associated-values-with-rex-from-raw/m-p/147148#M41131</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-02-19T18:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract keywords and associated values with rex from raw logs and display data in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-keywords-and-associated-values-with-rex-from-raw/m-p/147149#M41132</link>
      <description>&lt;P&gt;Thank you.. I tried, its just reading all SSN keyword(considering false positive) not extracting the values and listing out.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Feb 2015 19:02:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-keywords-and-associated-values-with-rex-from-raw/m-p/147149#M41132</guid>
      <dc:creator>satya2p</dc:creator>
      <dc:date>2015-02-19T19:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract keywords and associated values with rex from raw logs and display data in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-keywords-and-associated-values-with-rex-from-raw/m-p/147150#M41133</link>
      <description>&lt;P&gt;Let's try something simpler.  This should display all the SSN values found.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "SSN\&amp;gt;\s*(?P&amp;lt;SSN&amp;gt;\d{9})" | table SSN
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Feb 2015 19:14:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-keywords-and-associated-values-with-rex-from-raw/m-p/147150#M41133</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-02-19T19:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract keywords and associated values with rex from raw logs and display data in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-keywords-and-associated-values-with-rex-from-raw/m-p/147151#M41134</link>
      <description>&lt;P&gt;I tried this option earlier, table getting generated for each event logged by keyword but data is not populating.  seems its unable to extract values. I am using splunk 5.0.9, is xml filed extraction is available in this release. &lt;/P&gt;</description>
      <pubDate>Thu, 19 Feb 2015 19:20:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-keywords-and-associated-values-with-rex-from-raw/m-p/147151#M41134</guid>
      <dc:creator>satya2p</dc:creator>
      <dc:date>2015-02-19T19:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract keywords and associated values with rex from raw logs and display data in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-keywords-and-associated-values-with-rex-from-raw/m-p/147152#M41135</link>
      <description>&lt;P&gt;Yes, field extraction using the rex command is the same in version 5.  Is the sample data in your OP accurate?  Regex strings can be very sensitive to differences in white space, case, etc.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Feb 2015 19:23:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-keywords-and-associated-values-with-rex-from-raw/m-p/147152#M41135</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-02-19T19:23:52Z</dc:date>
    </item>
  </channel>
</rss>

