<?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 use fields from Main query in a map subquery? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-fields-from-Main-query-in-a-map-subquery/m-p/590555#M103449</link>
    <description>&lt;P&gt;Do you know that the map search you are giving actually finds anything?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;search index="***" sourcetype="xaxd:*****" "RevokeContributorAccess" "Deleting user A_KNOWN_CUSTOMER_EMAIL" earliest=-5m&lt;/LI-CODE&gt;&lt;P&gt;I have run a similar test and it passes the earliest time in the search.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Mar 2022 03:36:25 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2022-03-24T03:36:25Z</dc:date>
    <item>
      <title>How to use fields from Main query in a map subquery?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-fields-from-Main-query-in-a-map-subquery/m-p/590326#M103431</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="***" sourcetype="xaxd:*****" "GrantContributorAccess" "Assigned Contributor role to user"
| rex field=Message "\[****=(?&amp;lt;accessId&amp;gt;.*?)\] - Assigned Contributor role to user (?&amp;lt;customerEmail&amp;gt;.*?) for customerId=(?&amp;lt;customerId&amp;gt;.*?) in directoryName=(?&amp;lt;azureDirectory&amp;gt;.*?) in subscriptionId=(?&amp;lt;subscriptionId&amp;gt;.*?)$"
| stats max(_time) as LATEST_ASSIGN by customerEmail | eval LATEST_ASSIGN=strftime(LATEST_ASSIGN,"%Y-%m-%d %H:%M:%S")
| map maxsearches=1000 search="search index="***" sourcetype="xaxd:*****" "RevokeContributorAccess" "Deleting user $customerEmail$" earliest=$LATEST_ASSIGN$" 
| rex field=Message "\[RevokeContributorAccess=(?&amp;lt;accessId&amp;gt;.*?)\] - Deleting user (?&amp;lt;customerEmail&amp;gt;.*?) from AzureAD$"
| stats max(_time) as LATEST_REVOKE by customerEmail | eval LATEST_REVOKE=strftime(LATEST_REVOKE,"%Y-%m-%d %H:%M:%S")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to use the field "LATEST_ASSIGN" in the mapping subqueries as the "earliest" time for them.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please help. Thanks in advance.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Prem&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 05:08:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-fields-from-Main-query-in-a-map-subquery/m-p/590326#M103431</guid>
      <dc:creator>premkumarbilla</dc:creator>
      <dc:date>2022-03-23T05:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to use fields from Main query in a map subquery?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-fields-from-Main-query-in-a-map-subquery/m-p/590328#M103432</link>
      <description>&lt;P&gt;Rather than formatting LATEST_ASSIGN, just leave it as the max(_time) value and that should work - you can always format it for display after the map command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 05:32:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-fields-from-Main-query-in-a-map-subquery/m-p/590328#M103432</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-03-23T05:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to use fields from Main query in a map subquery?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-fields-from-Main-query-in-a-map-subquery/m-p/590329#M103433</link>
      <description>&lt;LI-CODE lang="markup"&gt;index="***" sourcetype="xaxd:*****" "GrantContributorAccess" "Assigned Contributor role to user"
| rex field=Message "\[****=(?&amp;lt;accessId&amp;gt;.*?)\] - Assigned Contributor role to user (?&amp;lt;customerEmail&amp;gt;.*?) for customerId=(?&amp;lt;customerId&amp;gt;.*?) in directoryName=(?&amp;lt;azureDirectory&amp;gt;.*?) in subscriptionId=(?&amp;lt;subscriptionId&amp;gt;.*?)$"
| map maxsearches=1000 search="search index="***" sourcetype="xaxd:*****" "RevokeContributorAccess" "Deleting user $customerEmail$" earliest=max(_time)"
| rex field=Message "\[RevokeContributorAccess=(?&amp;lt;accessId&amp;gt;.*?)\] - Deleting user (?&amp;lt;customerEmail&amp;gt;.*?) from AzureAD$"
| stats max(_time) as LATEST_REVOKE by customerEmail | eval LATEST_REVOKE=strftime(LATEST_REVOKE,"%Y-%m-%d %H:%M:%S")&lt;/LI-CODE&gt;&lt;P&gt;Used this but the sub query is not exactly working according to given timeline. I am expecting results after the earliest time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 05:39:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-fields-from-Main-query-in-a-map-subquery/m-p/590329#M103433</guid>
      <dc:creator>premkumarbilla</dc:creator>
      <dc:date>2022-03-23T05:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to use fields from Main query in a map subquery?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-fields-from-Main-query-in-a-map-subquery/m-p/590339#M103435</link>
      <description>&lt;P&gt;I didn't mean use the string "max(_time)" but instead use LATEST_ASSIGN as you are doing, just do not format it as a string, which will not be supported in that format&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats max(_time) as LATEST_ASSIGN by customerEmail 
| map maxsearches=1000 search="search index="***" sourcetype="xaxd:*****" "RevokeContributorAccess" "Deleting user $customerEmail$" earliest=$LATEST_ASSIGN$" &lt;/LI-CODE&gt;&lt;P&gt;Your LATEST_ASSIGN value will be an epoch value and that is good for earliest=...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 06:59:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-fields-from-Main-query-in-a-map-subquery/m-p/590339#M103435</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-03-23T06:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to use fields from Main query in a map subquery?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-fields-from-Main-query-in-a-map-subquery/m-p/590341#M103436</link>
      <description>&lt;P&gt;Tried this as well, it doesn't appear to be picking the earliest time, i actually tried normal notations like "-5m" as the value. It's not picking it.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 07:05:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-fields-from-Main-query-in-a-map-subquery/m-p/590341#M103436</guid>
      <dc:creator>premkumarbilla</dc:creator>
      <dc:date>2022-03-23T07:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to use fields from Main query in a map subquery?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-fields-from-Main-query-in-a-map-subquery/m-p/590555#M103449</link>
      <description>&lt;P&gt;Do you know that the map search you are giving actually finds anything?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;search index="***" sourcetype="xaxd:*****" "RevokeContributorAccess" "Deleting user A_KNOWN_CUSTOMER_EMAIL" earliest=-5m&lt;/LI-CODE&gt;&lt;P&gt;I have run a similar test and it passes the earliest time in the search.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 03:36:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-fields-from-Main-query-in-a-map-subquery/m-p/590555#M103449</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-03-24T03:36:25Z</dc:date>
    </item>
  </channel>
</rss>

