<?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: Need to extract fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41402#M178972</link>
    <description>&lt;P&gt;heres te thing when I use &lt;BR /&gt;
rex field=raw "(?i)dataSetListCountInfo_(?P&lt;DATASET&gt;[^=]+)=(?P&lt;DATACOUNT&gt;d{1,3}+)" | stats sum(datacount) by dataset I get correct datacount numbers but wrong number of rows as the query only pics the 1st instance from different instances.dataset     sum(datacount) &lt;BR /&gt;
HKG_generic 36&lt;BR /&gt;
ca_corp_zero    2&lt;BR /&gt;
corp_zero   280&lt;BR /&gt;
ebz_europe  2&lt;BR /&gt;
icm 58&lt;/DATACOUNT&gt;&lt;/DATASET&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 12:51:08 GMT</pubDate>
    <dc:creator>ashu_g50</dc:creator>
    <dc:date>2020-09-28T12:51:08Z</dc:date>
    <item>
      <title>Need to extract fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41395#M178965</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have the following in my logs &lt;/P&gt;

&lt;P&gt;dataSetListCountInfo_&lt;EM&gt;HKG_generic=2&lt;BR /&gt;
dataSetListCountInfo&lt;/EM&gt;&lt;EM&gt;icm=72&lt;BR /&gt;
dataSetListCountInfo&lt;/EM&gt;_rm_strips=1&lt;/P&gt;

&lt;P&gt;what I want to achieve is &lt;BR /&gt;
HKG_generic 2&lt;BR /&gt;
icm         72&lt;BR /&gt;
rm_strips   1&lt;/P&gt;

&lt;P&gt;I have tried this rex field=&lt;EM&gt;raw "dataSetListCountInfo&lt;/EM&gt;\w(?&lt;DATASET&gt;.&lt;EM&gt;)=\w(?&lt;DATACOUNT&gt;.&lt;/DATACOUNT&gt;&lt;/EM&gt;)" | stats sum(datacount) by dataset&lt;/DATASET&gt;&lt;/P&gt;

&lt;P&gt;Can someone please help&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:50:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41395#M178965</guid>
      <dc:creator>ashu_g50</dc:creator>
      <dc:date>2020-09-28T12:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Need to extract fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41396#M178966</link>
      <description>&lt;P&gt;i think the rex (?i)dataSetListCountInfo(?P&lt;DATASET&gt;[^=]+)=(?P&lt;DATACOUNT&gt;[^ ]+)&lt;BR /&gt;
will work&lt;BR /&gt;
so update the search as &lt;BR /&gt;
    rex field=raw "(?i)dataSetListCountInfo(?P&lt;DATASET&gt;[^=]+)=(?P&lt;DATACOUNT&gt;[^ ]+)" | top dataset,datacount|table dtatset datacount&lt;/DATACOUNT&gt;&lt;/DATASET&gt;&lt;/DATACOUNT&gt;&lt;/DATASET&gt;&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2012 11:08:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41396#M178966</guid>
      <dc:creator>smolcj</dc:creator>
      <dc:date>2012-11-21T11:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need to extract fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41397#M178967</link>
      <description>&lt;P&gt;Indeed it worked, just had to tweak it a lil &lt;/P&gt;

&lt;P&gt;rex field=&lt;EM&gt;raw "(?i)dataSetListCountInfo&lt;/EM&gt;(?P&lt;DATASET&gt;[^=]+)=(?P&lt;DATACOUNT&gt;[^ ])"  | stats sum(datacount) by dataset &lt;/DATACOUNT&gt;&lt;/DATASET&gt;&lt;/P&gt;

&lt;P&gt;Good one thanks mate!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2012 11:14:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41397#M178967</guid>
      <dc:creator>ashu_g50</dc:creator>
      <dc:date>2012-11-21T11:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need to extract fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41398#M178968</link>
      <description>&lt;P&gt;Hi Apologies, &lt;/P&gt;

&lt;P&gt;But theres a problem with the query &lt;/P&gt;

&lt;P&gt;It only takes the 1st instance for eg &lt;/P&gt;

&lt;P&gt;lets say the log shows &lt;/P&gt;

&lt;P&gt;........&lt;BR /&gt;
dataSetListCountInfoHKG_generic=2&lt;BR /&gt;
dataSetListCountInfoicm=72&lt;BR /&gt;
dataSetListCountInfo__rm_strips=1&lt;BR /&gt;
.......&lt;/P&gt;

&lt;P&gt;.....&lt;BR /&gt;
dataSetListCountInfoHKG_generic=6&lt;BR /&gt;
dataSetListCountInfoicm=9&lt;BR /&gt;
dataSetListCountInfo__rm_strips=5&lt;BR /&gt;
........&lt;/P&gt;

&lt;P&gt;So what I want is &lt;BR /&gt;
HKG_generic 8&lt;BR /&gt;
icm         81&lt;BR /&gt;
rm_strips   6&lt;/P&gt;

&lt;P&gt;But the query would give me &lt;/P&gt;

&lt;P&gt;HKG_generic 8&lt;/P&gt;

&lt;P&gt;the other two instances are ignored, how do I take into account the others ? &lt;/P&gt;

&lt;P&gt;Sorry if I wasnt clear thanks&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:50:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41398#M178968</guid>
      <dc:creator>ashu_g50</dc:creator>
      <dc:date>2020-09-28T12:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need to extract fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41399#M178969</link>
      <description>&lt;P&gt;All these values are in same event? can u give an outline of your log?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2012 08:30:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41399#M178969</guid>
      <dc:creator>smolcj</dc:creator>
      <dc:date>2012-11-22T08:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need to extract fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41400#M178970</link>
      <description>&lt;P&gt;no these are different eventsmoreover its not only these fields other fileds as well like eg below&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2012 09:26:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41400#M178970</guid>
      <dc:creator>ashu_g50</dc:creator>
      <dc:date>2012-11-22T09:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need to extract fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41401#M178971</link>
      <description>&lt;P&gt;11/21/12&lt;BR /&gt;
6:36:11.302 PM 2012-11-21 18:36:11,302 INFO [accounting-service:riskserver-query-service:ManagedQuery", processID="null", analysisDefinitionID=1648795233, metainfoID=2418180724&lt;BR /&gt;
.................&lt;BR /&gt;
modelTypeAndNumberSeenList_&lt;EM&gt;bondFutureOptionModel=1modelTypeAndNumberSeenList&lt;/EM&gt;&lt;EM&gt;swaptionModel=5modelTypeAndNumberSeenList&lt;/EM&gt;&lt;EM&gt;genericMortgageBackedSecurityModel=1dataSetListCountInfo&lt;/EM&gt;&lt;EM&gt;corp_zero=32dataSetListCountInfo&lt;/EM&gt;&lt;EM&gt;ebz_europe=6dataSetListCountInfo&lt;/EM&gt;&lt;EM&gt;icm=362dataSetListCountInfo&lt;/EM&gt;&lt;EM&gt;mbs=2dataSetListCountInfo&lt;/EM&gt;&lt;EM&gt;rm_iso=2dataSetListCountInfo&lt;/EM&gt;&lt;EM&gt;rm_strips=2localPricings&lt;/EM&gt;_localPricings=382400..............&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:51:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41401#M178971</guid>
      <dc:creator>ashu_g50</dc:creator>
      <dc:date>2020-09-28T12:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need to extract fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41402#M178972</link>
      <description>&lt;P&gt;heres te thing when I use &lt;BR /&gt;
rex field=raw "(?i)dataSetListCountInfo_(?P&lt;DATASET&gt;[^=]+)=(?P&lt;DATACOUNT&gt;d{1,3}+)" | stats sum(datacount) by dataset I get correct datacount numbers but wrong number of rows as the query only pics the 1st instance from different instances.dataset     sum(datacount) &lt;BR /&gt;
HKG_generic 36&lt;BR /&gt;
ca_corp_zero    2&lt;BR /&gt;
corp_zero   280&lt;BR /&gt;
ebz_europe  2&lt;BR /&gt;
icm 58&lt;/DATACOUNT&gt;&lt;/DATASET&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:51:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41402#M178972</guid>
      <dc:creator>ashu_g50</dc:creator>
      <dc:date>2020-09-28T12:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Need to extract fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41403#M178973</link>
      <description>&lt;P&gt;now when i use &lt;BR /&gt;
rex field=raw max_match=20 "(?i)dataSetListCountInfo_(?P&lt;DATASET&gt;[^=]+)=(?P&lt;DATACOUNT&gt;d{1,3}+)" | stats sum(datacount) by dataset, I get the correct number of rows expected but you see the datacount value? its wrong.dataset     sum(datacount) &lt;BR /&gt;
HKG_generic 2294&lt;BR /&gt;
ca_corp_zero    1534&lt;BR /&gt;
corp_zero   5185&lt;BR /&gt;
ebz_europe  5211&lt;BR /&gt;
icm 6471&lt;BR /&gt;
mbs 4993&lt;BR /&gt;
rm_agency   1594&lt;BR /&gt;
rm_iso  4993&lt;BR /&gt;
rm_strips   6193&lt;/DATACOUNT&gt;&lt;/DATASET&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:51:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-extract-fields/m-p/41403#M178973</guid>
      <dc:creator>ashu_g50</dc:creator>
      <dc:date>2020-09-28T12:51:12Z</dc:date>
    </item>
  </channel>
</rss>

