<?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 rex field list values assign dynamically to source path as subquery ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-rex-field-list-values-assign-dynamically-to-source-path-as/m-p/529691#M149627</link>
    <description>&lt;P&gt;If you get the right results with search instead of where, does the map function do what you want?&lt;/P&gt;&lt;P&gt;I don't understand why search works but where doesn't. Does the rec_prod_step_function field get extracted successfully? Can you provide the results of the successful query?&lt;/P&gt;</description>
    <pubDate>Tue, 17 Nov 2020 07:50:13 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2020-11-17T07:50:13Z</dc:date>
    <item>
      <title>How rex field list values assign dynamically to source path as subquery ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-rex-field-list-values-assign-dynamically-to-source-path-as/m-p/529643#M149603</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Query one returns a result with one fields as list of values. I want to&amp;nbsp; pass those list of value as the search source path and result returns for second query. Given below is the detail.&lt;/P&gt;&lt;P&gt;Please suggest how to achieve ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query1 :&amp;nbsp;&lt;/P&gt;&lt;P&gt;index="os" (source="/var/log/steps/*/controller")&amp;nbsp; sourcetype="too_small" (host="ip-101-108-*-*" OR host="ip-101-109-*-*") | transaction source startswith=("/code/ttt_env.sh" OR "/code/ttt_gen.sh" ) endswith="startRun() called" | rex field=_raw "(?&amp;lt;step_function&amp;gt;\bs-[a-zA-Z0-9_]+)"&lt;/P&gt;&lt;P&gt;It does return the output and value of&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query1 Output :&amp;nbsp;&lt;/P&gt;&lt;P&gt;step_function values listed as&amp;nbsp; in field like :&amp;nbsp;&lt;A href="https://splunk.gartner.com/en-US/app/search_wild/search?q=search%20index%3D%22os%22%20(source%3D%22%2Fvar%2Flog%2Fhadoop%2Fsteps%2F*%2Fcontroller%22)%20sourcetype%3D%22too_small%22%20(host%3D%22ip-10-108-8-*%22%20OR%20host%3D%22ip-10-108-9-*%22)%20%7C%20transaction%20source%20startswith%3D(%22%2Fopt%2Fcode%2Fondemand%2Fyarn_env.sh%22%20%20%09OR%20%22%2Fopt%2Fcode%2Fdaily%2Fdaily_generate.sh%22%20%20%20%20%20)%20endswith%3D%22startRun()%20called%22%20%7C%20rex%20field%3D_raw%20%22(%3F%3Crec_prod_step_function%3E%5Cbs-%5Ba-zA-Z0-9_%5D%2B)%22%20%7C%20append%20%5Bsearch%20index%3D%22os%22%20source%3D%22%2Fvar%2Flog%2Fhadoop%2Fsteps%2F(%3F%3Crec_prod_step_function%3E%5Cbs-%5Ba-zA-Z0-9_%5D%2B)%2Fstdout%22%20sourcetype%3D%22too_small%22%20(host%3D%22ip-10-108-8-*%22%20OR%20host%3D%22ip-10-108-9-*%22)%5D&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;earliest=-20h&amp;amp;latest=now&amp;amp;display.events.fields=%5B%22host%22%2C%22sourcetype%22%2C%22source%22%2C%22caller_ip%22%2C%22aws_personalize_time%22%2C%22HADOOP_CLIENT_OPTS%22%2C%22HADOOP_IDENT_STRING%22%2C%22HADOOP_LOGFILE%22%2C%22HADOOP_LOG_DIR%22%2C%22HADOOP_ROOT_LOGGER%22%2C%22GUSER%22%2C%22HOSTNAME%22%2C%22LOGNAME%22%2C%22AWS_AUTO_SCALING_HOME%22%2C%22AWS_CLOUDWATCH_HOME%22%2C%22AWS_DEFAULT_REGION%22%2C%22AWS_ELB_HOME%22%2C%22AWS_PATH%22%2C%22unix_group%22%2C%22unix_category%22%2C%22state%22%2C%22tag%22%2C%22tag%3A%3Aeventtype%22%2C%22rec_prod_step_function%22%5D&amp;amp;display.prefs.fieldFilter=step&amp;amp;sid=1605562351.21028#" target="_blank" rel="noopener"&gt;s-BBBUL8NJBYE45&lt;/A&gt;,&amp;nbsp;&lt;A href="https://splunk.gartner.com/en-US/app/search_wild/search?q=search%20index%3D%22os%22%20(source%3D%22%2Fvar%2Flog%2Fhadoop%2Fsteps%2F*%2Fcontroller%22)%20sourcetype%3D%22too_small%22%20(host%3D%22ip-10-108-8-*%22%20OR%20host%3D%22ip-10-108-9-*%22)%20%7C%20transaction%20source%20startswith%3D(%22%2Fopt%2Fcode%2Fondemand%2Fyarn_env.sh%22%20%20%09OR%20%22%2Fopt%2Fcode%2Fdaily%2Fdaily_generate.sh%22%20%20%20%20%20)%20endswith%3D%22startRun()%20called%22%20%7C%20rex%20field%3D_raw%20%22(%3F%3Crec_prod_step_function%3E%5Cbs-%5Ba-zA-Z0-9_%5D%2B)%22%20%7C%20append%20%5Bsearch%20index%3D%22os%22%20source%3D%22%2Fvar%2Flog%2Fhadoop%2Fsteps%2F(%3F%3Crec_prod_step_function%3E%5Cbs-%5Ba-zA-Z0-9_%5D%2B)%2Fstdout%22%20sourcetype%3D%22too_small%22%20(host%3D%22ip-10-108-8-*%22%20OR%20host%3D%22ip-10-108-9-*%22)%5D&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;earliest=-20h&amp;amp;latest=now&amp;amp;display.events.fields=%5B%22host%22%2C%22sourcetype%22%2C%22source%22%2C%22caller_ip%22%2C%22aws_personalize_time%22%2C%22HADOOP_CLIENT_OPTS%22%2C%22HADOOP_IDENT_STRING%22%2C%22HADOOP_LOGFILE%22%2C%22HADOOP_LOG_DIR%22%2C%22HADOOP_ROOT_LOGGER%22%2C%22GUSER%22%2C%22HOSTNAME%22%2C%22LOGNAME%22%2C%22AWS_AUTO_SCALING_HOME%22%2C%22AWS_CLOUDWATCH_HOME%22%2C%22AWS_DEFAULT_REGION%22%2C%22AWS_ELB_HOME%22%2C%22AWS_PATH%22%2C%22unix_group%22%2C%22unix_category%22%2C%22state%22%2C%22tag%22%2C%22tag%3A%3Aeventtype%22%2C%22rec_prod_step_function%22%5D&amp;amp;display.prefs.fieldFilter=step&amp;amp;sid=1605562351.21028#" target="_blank" rel="noopener"&gt;s-AAAUL8NJBYEI3&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Now these value I want to generate the further query using&amp;nbsp;step_function values like ( Hard coded by hand it worked)&lt;/P&gt;&lt;P&gt;append [search index="os" source=("&lt;STRONG&gt;/var/log/steps/&lt;A href="https://splunk.gartner.com/en-US/app/search_wild/search?q=search%20index%3D%22os%22%20(source%3D%22%2Fvar%2Flog%2Fhadoop%2Fsteps%2F*%2Fcontroller%22)%20sourcetype%3D%22too_small%22%20(host%3D%22ip-10-108-8-*%22%20OR%20host%3D%22ip-10-108-9-*%22)%20%7C%20transaction%20source%20startswith%3D(%22%2Fopt%2Fcode%2Fondemand%2Fyarn_env.sh%22%20%20%09OR%20%22%2Fopt%2Fcode%2Fdaily%2Fdaily_generate.sh%22%20%20%20%20%20)%20endswith%3D%22startRun()%20called%22%20%7C%20rex%20field%3D_raw%20%22(%3F%3Crec_prod_step_function%3E%5Cbs-%5Ba-zA-Z0-9_%5D%2B)%22%20%7C%20append%20%5Bsearch%20index%3D%22os%22%20source%3D%22%2Fvar%2Flog%2Fhadoop%2Fsteps%2F(%3F%3Crec_prod_step_function%3E%5Cbs-%5Ba-zA-Z0-9_%5D%2B)%2Fstdout%22%20sourcetype%3D%22too_small%22%20(host%3D%22ip-10-108-8-*%22%20OR%20host%3D%22ip-10-108-9-*%22)%5D&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;earliest=-20h&amp;amp;latest=now&amp;amp;display.events.fields=%5B%22host%22%2C%22sourcetype%22%2C%22source%22%2C%22caller_ip%22%2C%22aws_personalize_time%22%2C%22HADOOP_CLIENT_OPTS%22%2C%22HADOOP_IDENT_STRING%22%2C%22HADOOP_LOGFILE%22%2C%22HADOOP_LOG_DIR%22%2C%22HADOOP_ROOT_LOGGER%22%2C%22GUSER%22%2C%22HOSTNAME%22%2C%22LOGNAME%22%2C%22AWS_AUTO_SCALING_HOME%22%2C%22AWS_CLOUDWATCH_HOME%22%2C%22AWS_DEFAULT_REGION%22%2C%22AWS_ELB_HOME%22%2C%22AWS_PATH%22%2C%22unix_group%22%2C%22unix_category%22%2C%22state%22%2C%22tag%22%2C%22tag%3A%3Aeventtype%22%2C%22rec_prod_step_function%22%5D&amp;amp;display.prefs.fieldFilter=step&amp;amp;sid=1605562351.21028#" target="_blank" rel="noopener"&gt;s-BBBUL8NJBYE45&lt;/A&gt;/stdout&lt;/STRONG&gt;" OR&amp;nbsp;&lt;STRONG&gt;/var/log/steps/&lt;A href="https://splunk.gartner.com/en-US/app/search_wild/search?q=search%20index%3D%22os%22%20(source%3D%22%2Fvar%2Flog%2Fhadoop%2Fsteps%2F*%2Fcontroller%22)%20sourcetype%3D%22too_small%22%20(host%3D%22ip-10-108-8-*%22%20OR%20host%3D%22ip-10-108-9-*%22)%20%7C%20transaction%20source%20startswith%3D(%22%2Fopt%2Fcode%2Fondemand%2Fyarn_env.sh%22%20%20%09OR%20%22%2Fopt%2Fcode%2Fdaily%2Fdaily_generate.sh%22%20%20%20%20%20)%20endswith%3D%22startRun()%20called%22%20%7C%20rex%20field%3D_raw%20%22(%3F%3Crec_prod_step_function%3E%5Cbs-%5Ba-zA-Z0-9_%5D%2B)%22%20%7C%20append%20%5Bsearch%20index%3D%22os%22%20source%3D%22%2Fvar%2Flog%2Fhadoop%2Fsteps%2F(%3F%3Crec_prod_step_function%3E%5Cbs-%5Ba-zA-Z0-9_%5D%2B)%2Fstdout%22%20sourcetype%3D%22too_small%22%20(host%3D%22ip-10-108-8-*%22%20OR%20host%3D%22ip-10-108-9-*%22)%5D&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;earliest=-20h&amp;amp;latest=now&amp;amp;display.events.fields=%5B%22host%22%2C%22sourcetype%22%2C%22source%22%2C%22caller_ip%22%2C%22aws_personalize_time%22%2C%22HADOOP_CLIENT_OPTS%22%2C%22HADOOP_IDENT_STRING%22%2C%22HADOOP_LOGFILE%22%2C%22HADOOP_LOG_DIR%22%2C%22HADOOP_ROOT_LOGGER%22%2C%22GUSER%22%2C%22HOSTNAME%22%2C%22LOGNAME%22%2C%22AWS_AUTO_SCALING_HOME%22%2C%22AWS_CLOUDWATCH_HOME%22%2C%22AWS_DEFAULT_REGION%22%2C%22AWS_ELB_HOME%22%2C%22AWS_PATH%22%2C%22unix_group%22%2C%22unix_category%22%2C%22state%22%2C%22tag%22%2C%22tag%3A%3Aeventtype%22%2C%22rec_prod_step_function%22%5D&amp;amp;display.prefs.fieldFilter=step&amp;amp;sid=1605562351.21028#" target="_blank" rel="noopener"&gt;s-&lt;/A&gt;&lt;A href="https://splunk.gartner.com/en-US/app/search_wild/search?q=search%20index%3D%22os%22%20(source%3D%22%2Fvar%2Flog%2Fhadoop%2Fsteps%2F*%2Fcontroller%22)%20sourcetype%3D%22too_small%22%20(host%3D%22ip-10-108-8-*%22%20OR%20host%3D%22ip-10-108-9-*%22)%20%7C%20transaction%20source%20startswith%3D(%22%2Fopt%2Fcode%2Fondemand%2Fyarn_env.sh%22%20%20%09OR%20%22%2Fopt%2Fcode%2Fdaily%2Fdaily_generate.sh%22%20%20%20%20%20)%20endswith%3D%22startRun()%20called%22%20%7C%20rex%20field%3D_raw%20%22(%3F%3Crec_prod_step_function%3E%5Cbs-%5Ba-zA-Z0-9_%5D%2B)%22%20%7C%20append%20%5Bsearch%20index%3D%22os%22%20source%3D%22%2Fvar%2Flog%2Fhadoop%2Fsteps%2F(%3F%3Crec_prod_step_function%3E%5Cbs-%5Ba-zA-Z0-9_%5D%2B)%2Fstdout%22%20sourcetype%3D%22too_small%22%20(host%3D%22ip-10-108-8-*%22%20OR%20host%3D%22ip-10-108-9-*%22)%5D&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;earliest=-20h&amp;amp;latest=now&amp;amp;display.events.fields=%5B%22host%22%2C%22sourcetype%22%2C%22source%22%2C%22caller_ip%22%2C%22aws_personalize_time%22%2C%22HADOOP_CLIENT_OPTS%22%2C%22HADOOP_IDENT_STRING%22%2C%22HADOOP_LOGFILE%22%2C%22HADOOP_LOG_DIR%22%2C%22HADOOP_ROOT_LOGGER%22%2C%22GUSER%22%2C%22HOSTNAME%22%2C%22LOGNAME%22%2C%22AWS_AUTO_SCALING_HOME%22%2C%22AWS_CLOUDWATCH_HOME%22%2C%22AWS_DEFAULT_REGION%22%2C%22AWS_ELB_HOME%22%2C%22AWS_PATH%22%2C%22unix_group%22%2C%22unix_category%22%2C%22state%22%2C%22tag%22%2C%22tag%3A%3Aeventtype%22%2C%22rec_prod_step_function%22%5D&amp;amp;display.prefs.fieldFilter=step&amp;amp;sid=1605562351.21028#" target="_blank" rel="noopener"&gt;s-AAAUL8NJBYEI3&lt;/A&gt;/stdout&lt;/STRONG&gt;")&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;sourcetype="too_small" (host="ip-101-108-*-*"" OR host="ip-101-108-*-*"*")]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;How to perform dynamically and achieve this functionality without hardcoding.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried like this but didn't work&amp;nbsp;&lt;/P&gt;&lt;P&gt;index="os" (source="/var/log/steps/*/controller") sourcetype="too_small" (host="&lt;SPAN&gt;ip-101-108-*-*&lt;/SPAN&gt;" OR host="&lt;SPAN&gt;ip-101-108-*-*&lt;/SPAN&gt;") |&lt;BR /&gt;transaction source startswith=("/code/ttt_env.sh" OR "/code/ttt_gen.sh") endswith="startRun() called" |&lt;BR /&gt;rex field=_raw "(?&amp;lt;rec_prod_step_function&amp;gt;\bs-[a-zA-Z0-9_]+)" | &lt;STRONG&gt;search rec_prod_step_function="*"&lt;/STRONG&gt;&lt;BR /&gt;|&lt;STRONG&gt; append&lt;/STRONG&gt; &lt;STRONG&gt;[search index="os" source="/var/log/steps/$rec_prod_step_function$/stdout" sourcetype="too_small" (host="&lt;SPAN&gt;ip-101-108-*-*&lt;/SPAN&gt;" OR host="&lt;SPAN&gt;ip-101-108-*-*&lt;/SPAN&gt;")]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note : "/var/log/steps/$rec_prod_step_function$/stdout" &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 22:41:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-rex-field-list-values-assign-dynamically-to-source-path-as/m-p/529643#M149603</guid>
      <dc:creator>alok</dc:creator>
      <dc:date>2020-11-16T22:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: How rex field list values assign dynamically to source path as subquery ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-rex-field-list-values-assign-dynamically-to-source-path-as/m-p/529647#M149605</link>
      <description>&lt;P&gt;Rather than append, try using map&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="os" (source="/var/log/steps/*/controller") sourcetype="too_small" (host="ip-101-108-*-*" OR host="ip-101-108-*-*") |
transaction source startswith=("/code/ttt_env.sh" OR "/code/ttt_gen.sh") endswith="startRun() called" |
rex field=_raw "(?&amp;lt;rec_prod_step_function&amp;gt;\bs-[a-zA-Z0-9_]+)" | where rec_prod_step_function="*"
| map search="search index=\"os\" source=\"/var/log/steps/$rec_prod_step_function$/stdout\" sourcetype=\"too_small\" (host=\"ip-101-108-*-*\" OR host=\"ip-101-108-*-*\")" maxsearches=0&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 16 Nov 2020 23:54:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-rex-field-list-values-assign-dynamically-to-source-path-as/m-p/529647#M149605</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-11-16T23:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: How rex field list values assign dynamically to source path as subquery ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-rex-field-list-values-assign-dynamically-to-source-path-as/m-p/529654#M149608</link>
      <description>&lt;P&gt;I ran the suggested query getting a error message&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Error in 'map': Did not find value for required attribute 'rec_prod_step_function'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;P&gt;As debug I break the query when I ran&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="os" (source="/var/log/steps/*/controller") sourcetype="too_small" (host="ip-101-108-*-*" OR host="ip-101-108-*-*") |
transaction source startswith=("/code/ttt_env.sh" OR "/code/ttt_gen.sh") endswith="startRun() called" |
rex field=_raw "(?&amp;lt;rec_prod_step_function&amp;gt;\bs-[a-zA-Z0-9_]+)" | where rec_prod_step_function="*"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is not returning any event.&lt;/P&gt;&lt;P&gt;but when I used "where" to "search"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="os" (source="/var/log/steps/*/controller") sourcetype="too_small" (host="ip-101-108-*-*" OR host="ip-101-108-*-*") |
transaction source startswith=("/code/ttt_env.sh" OR "/code/ttt_gen.sh") endswith="startRun() called" |
rex field=_raw "(?&amp;lt;rec_prod_step_function&amp;gt;\bs-[a-zA-Z0-9_]+)" | search rec_prod_step_function="*"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query returns two events that is correct.&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;P&gt;Thanks !!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 03:09:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-rex-field-list-values-assign-dynamically-to-source-path-as/m-p/529654#M149608</guid>
      <dc:creator>alok</dc:creator>
      <dc:date>2020-11-17T03:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: How rex field list values assign dynamically to source path as subquery ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-rex-field-list-values-assign-dynamically-to-source-path-as/m-p/529691#M149627</link>
      <description>&lt;P&gt;If you get the right results with search instead of where, does the map function do what you want?&lt;/P&gt;&lt;P&gt;I don't understand why search works but where doesn't. Does the rec_prod_step_function field get extracted successfully? Can you provide the results of the successful query?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 07:50:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-rex-field-list-values-assign-dynamically-to-source-path-as/m-p/529691#M149627</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-11-17T07:50:13Z</dc:date>
    </item>
  </channel>
</rss>

