<?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 can I use pre evaluated param in my rex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-pre-evaluated-param-in-my-rex/m-p/532746#M150510</link>
    <description>&lt;P&gt;The important part here is your dashboard token handling, not the query. In order to generate a temp token from the script, this would be done in the drilldown logic of your dashboard, bnot the query. You cannot do this in the query itself. Please post the dashboard logic you are using to set the relevant tokens.&lt;/P&gt;&lt;P&gt;Also, I don't know what your data is like, but I would suggest finding a better way of doing your search. It is rarely necessary to use join - and the fact that you are using 3 subsearches is most likely a very bad idea and most likely not necessary.&lt;/P&gt;&lt;P&gt;Generally you only have to do a single search and use aggregation and evaluations to get the correct data filtered. Your 4 searches will all have to be done separately - and will each have to run independently, so is likely to be very slow in comparison to a more optimal search.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Dec 2020 06:29:37 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2020-12-11T06:29:37Z</dc:date>
    <item>
      <title>How can I use pre evaluated param in my rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-pre-evaluated-param-in-my-rex/m-p/531899#M150252</link>
      <description>&lt;P&gt;I'm getting from my dashboard parameter with '_' value in it, I would like to start my search by evaluating a new parameter without the&amp;nbsp;'_' and then use it in my search.&lt;BR /&gt;In Addition, I would like to inject this parameter into my regex and do another manipulation on my result.&lt;BR /&gt;&lt;BR /&gt;This is my query:&lt;/P&gt;&lt;LI-SPOILER&gt;index=* |eval temp = ("my_value","_","")| "ERROR" "Exception in script execution" "at scripts.$temp$."&lt;BR /&gt;[search index=* script_name=my_value tid=*&lt;BR /&gt;| head 1 | return tid]&lt;BR /&gt;| rex "at\sscripts.$temp$.(?&amp;lt;stack_trace&amp;gt;[^\t\n\s]+)"&lt;BR /&gt;| head 1 | table stack_trace&lt;/LI-SPOILER&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;I would like it to be searched like that:&lt;/P&gt;&lt;LI-SPOILER&gt;index=* |eval temp = ("my_value","_","")| "ERROR" "Exception in script execution" "at scripts.myvalue."&lt;BR /&gt;[search index=* script_name=my_value tid=*&lt;BR /&gt;| head 1 | return tid]&lt;BR /&gt;| rex "at\sscripts.myvalue.(?&amp;lt;stack_trace&amp;gt;[^\t\n\s]+)"&lt;BR /&gt;| head 1 | table stack_trace&lt;/LI-SPOILER&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;I can't seem to figure it out, could somebody help me?&lt;BR /&gt;&lt;BR /&gt;Thanks:)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 17:33:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-pre-evaluated-param-in-my-rex/m-p/531899#M150252</guid>
      <dc:creator>ortalis</dc:creator>
      <dc:date>2020-12-03T17:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use pre evaluated param in my rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-pre-evaluated-param-in-my-rex/m-p/531927#M150262</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229408"&gt;@ortalis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you talking about a token in your dashboard that you are passing to a search. If so, why not remove the _ in the token before you pass it to the query. Then you can use the token as is, without having to change it in the query.&lt;/P&gt;&lt;P&gt;Your query examples don't seem to be valid queries though, so not totally clear on how you are getting your value. Can you provide more info.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 21:59:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-pre-evaluated-param-in-my-rex/m-p/531927#M150262</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-12-03T21:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use pre evaluated param in my rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-pre-evaluated-param-in-my-rex/m-p/532118#M150317</link>
      <description>&lt;P&gt;I have created a dashboard that I'm getting the value from the user.&lt;BR /&gt;I need to use this query also in a code I wrote so I need to find a way to replace these values so my query would work.&lt;BR /&gt;The query isn't valid right now since I don't know how to pre-evaluate the temp param before doing the search ("ERROR" "Exception in script execution" "at scripts.$temp$."), and then injecting the value to the rex command.&lt;BR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Dec 2020 08:47:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-pre-evaluated-param-in-my-rex/m-p/532118#M150317</guid>
      <dc:creator>ortalis</dc:creator>
      <dc:date>2020-12-06T08:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use pre evaluated param in my rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-pre-evaluated-param-in-my-rex/m-p/532135#M150322</link>
      <description>&lt;P&gt;Can you post the dashboard snippets of your inputs and searches, it's not clear to me what is needed&lt;/P&gt;</description>
      <pubDate>Sun, 06 Dec 2020 23:03:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-pre-evaluated-param-in-my-rex/m-p/532135#M150322</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-12-06T23:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use pre evaluated param in my rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-pre-evaluated-param-in-my-rex/m-p/532670#M150482</link>
      <description>&lt;P&gt;Here is our Query now:&lt;BR /&gt;&lt;BR /&gt;index=myindex script=$script$ customer_name=* run_number=*&lt;BR /&gt;| table customer_name&amp;nbsp; run_number&lt;BR /&gt;| join&amp;nbsp;run_number&lt;BR /&gt;[search index=myindex&lt;BR /&gt;[search index=myindex "ERROR" "at scripts.$temp$."&lt;BR /&gt;[search index=myindex script=$script$ customer_name=$customer_name$&amp;nbsp; run_number=*&lt;BR /&gt;| head 1 | return run_number]&lt;BR /&gt;| rex "at\sscripts.$temp$.(?&amp;lt;stack_trace&amp;gt;[^\t\n\s]+)"&lt;BR /&gt;| head 1 | table stack_trace&lt;BR /&gt;| return $stack_trace]&lt;BR /&gt;|table run_number]&lt;BR /&gt;&lt;BR /&gt;We dont want to get the "temp" value from the user.&lt;BR /&gt;We want to create it from the script name.&lt;BR /&gt;For example if the script name is: "or_m.pdf"&lt;BR /&gt;we want the remove the "_" and the suffix ".pdf" so it will be: "orm"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 16:19:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-pre-evaluated-param-in-my-rex/m-p/532670#M150482</guid>
      <dc:creator>ormal</dc:creator>
      <dc:date>2020-12-10T16:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use pre evaluated param in my rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-pre-evaluated-param-in-my-rex/m-p/532746#M150510</link>
      <description>&lt;P&gt;The important part here is your dashboard token handling, not the query. In order to generate a temp token from the script, this would be done in the drilldown logic of your dashboard, bnot the query. You cannot do this in the query itself. Please post the dashboard logic you are using to set the relevant tokens.&lt;/P&gt;&lt;P&gt;Also, I don't know what your data is like, but I would suggest finding a better way of doing your search. It is rarely necessary to use join - and the fact that you are using 3 subsearches is most likely a very bad idea and most likely not necessary.&lt;/P&gt;&lt;P&gt;Generally you only have to do a single search and use aggregation and evaluations to get the correct data filtered. Your 4 searches will all have to be done separately - and will each have to run independently, so is likely to be very slow in comparison to a more optimal search.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2020 06:29:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-pre-evaluated-param-in-my-rex/m-p/532746#M150510</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-12-11T06:29:37Z</dc:date>
    </item>
  </channel>
</rss>

