<?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 make search efficient with spath and regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492410#M137352</link>
    <description>&lt;P&gt;Its not too bad. I was wondering if there was a better way to do this. Since it has both regex and spath and also an eval&lt;/P&gt;</description>
    <pubDate>Thu, 21 Nov 2019 21:03:48 GMT</pubDate>
    <dc:creator>vjzone</dc:creator>
    <dc:date>2019-11-21T21:03:48Z</dc:date>
    <item>
      <title>How to make search efficient with spath and regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492408#M137350</link>
      <description>&lt;P&gt;How can I make this search efficient?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-1m source="/var/log/aws/opsworks/opsworks-agent.statistics.log"  host="*prod*" Reported statistics data
| dedup host
| rex field=_raw "Reported statistics data: (?&amp;lt;json&amp;gt;.*)\N"
| fields json, host
| spath input=json
| rename stats.memory.free as memFree, stats.memory.total as memtotal
| eval memFreePer=memFree/memtotal*100
| table host, memFreePer, stats.cpu.idle
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Nov 2019 17:29:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492408#M137350</guid>
      <dc:creator>vjzone</dc:creator>
      <dc:date>2019-11-21T17:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to make search efficient with spath and regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492409#M137351</link>
      <description>&lt;P&gt;What makes you think it's inefficient?  What does Job Inspector say?&lt;BR /&gt;
Have you tried replacing 'Reported statistics data' with ' "Reported statistics data:" ' in the base search?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 18:15:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492409#M137351</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-11-21T18:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to make search efficient with spath and regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492410#M137352</link>
      <description>&lt;P&gt;Its not too bad. I was wondering if there was a better way to do this. Since it has both regex and spath and also an eval&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 21:03:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492410#M137352</guid>
      <dc:creator>vjzone</dc:creator>
      <dc:date>2019-11-21T21:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to make search efficient with spath and regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492411#M137353</link>
      <description>&lt;P&gt;There is not greater efficiency to be had other than to explicitly specify an index; here is that along with some other clarification adjustments:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="YouShouldAlwaysSpecifyAnIndex" AND source="/var/log/aws/opsworks/opsworks-agent.statistics.log" AND host="prod" AND Reported AND statistics AND data
| dedup host
| rex "Reported statistics data: (?&amp;lt;json&amp;gt;.*)\N"
| fields json host
| spath input=json
| rename stats.memory.free AS memFree, stats.memory.total AS memtotal
| eval memFreePer = 100 * memFree / memtotal
| table host, memFreePer, stats.cpu.idle
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Nov 2019 22:53:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492411#M137353</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-21T22:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to make search efficient with spath and regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492412#M137354</link>
      <description>&lt;P&gt;Thanks woodcock. Every one of our logs has index=main, which is why i chose to ignore it. Apart from that, is the query alright?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 01:33:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492412#M137354</guid>
      <dc:creator>vjzone</dc:creator>
      <dc:date>2019-11-22T01:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to make search efficient with spath and regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492413#M137355</link>
      <description>&lt;P&gt;Yes, efficiency-wise, there is nothing to do, but there some best-practices that provide additional clarity as shown in my answer.  Is ALL of your data in &lt;CODE&gt;index=main&lt;/CODE&gt; or just the data you need for this purpose?  If the former, you should REALLY fix that.  In any case, do not ever run a search without specifying &lt;CODE&gt;index=&lt;/CODE&gt; somewhere.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 16:07:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492413#M137355</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-22T16:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to make search efficient with spath and regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492414#M137356</link>
      <description>&lt;P&gt;Is it possible for stats.memory.free and stats.memory.total to be extracted as fields as the log is ingested? This would save you search-time overhead and the cost of some disk space and ingest overhead.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 16:50:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492414#M137356</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2019-11-22T16:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to make search efficient with spath and regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492415#M137357</link>
      <description>&lt;P&gt;Thanks Jpolvino. Unfortunately splunk is administered by another group and I'll have to raise a request for it.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 16:56:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492415#M137357</guid>
      <dc:creator>vjzone</dc:creator>
      <dc:date>2019-11-22T16:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to make search efficient with spath and regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492416#M137358</link>
      <description>&lt;P&gt;Yes every application log is with index=main. I have asked for a change and it'll hopefully happen soon.&lt;/P&gt;

&lt;P&gt;Appreciate your response. &lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 16:58:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-search-efficient-with-spath-and-regex/m-p/492416#M137358</guid>
      <dc:creator>vjzone</dc:creator>
      <dc:date>2019-11-22T16:58:58Z</dc:date>
    </item>
  </channel>
</rss>

