<?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: Extract aws service name from source field of metadata in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-aws-service-name-from-source-field-of-metadata/m-p/684656#M233709</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp; : If dont use rex , it gets entire value i.e nat_gateways. I just want nat.&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;My requirement is it should just extract service name.&lt;BR /&gt;&lt;BR /&gt;Example :&lt;BR /&gt;434531263412:us-west-2:lambda_functions it will be lambda_functions. This is straight forward.&lt;BR /&gt;But like in&amp;nbsp; :&amp;nbsp;&lt;STRONG&gt;"434531263412:us-west-2:nat_gateways",&amp;nbsp;&lt;/STRONG&gt; it should be gateways.&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;434531263412&lt;/STRONG&gt;:&lt;STRONG&gt;us-west-2:application_load_balancers,&amp;nbsp;&lt;/STRONG&gt; it should be load_balancers&lt;BR /&gt;&lt;BR /&gt;This is my requirement.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Apr 2024 13:55:00 GMT</pubDate>
    <dc:creator>Poojitha</dc:creator>
    <dc:date>2024-04-18T13:55:00Z</dc:date>
    <item>
      <title>Extract aws service name from source field of metadata</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-aws-service-name-from-source-field-of-metadata/m-p/684642#M233705</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I want to extract service name from sourcetype="aws:metadata" and source field.&lt;BR /&gt;&lt;BR /&gt;Example : 434531263412:eu-central-1:elasticache_describe_reserved_cache_nodes_offerings&lt;BR /&gt;&lt;BR /&gt;I am using this query :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* sourcetype=aws:metadata
| eval aws_service=mvindex(split(source,":"),2)
| rex field=aws_service "(?&amp;lt;aws_service&amp;gt;[^_]+)"
| table aws_service  source| dedup aws_service&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Using this I will get result :&amp;nbsp; elasticache. But in case of&amp;nbsp;&lt;STRONG&gt;"434531263412:us-west-2:nat_gateways"&lt;/STRONG&gt; its just extracting nat. But it should be gateways. S&lt;BR /&gt;&lt;BR /&gt;Similarly in &lt;STRONG&gt;434531263412&lt;/STRONG&gt;:eu-central-1:application_load_balancers, its extracting application.&lt;BR /&gt;&lt;BR /&gt;I was thinking if we can check for the keyword and update the value. I want to add this in props.conf file so aws_service field gets created from source.&lt;BR /&gt;&lt;BR /&gt;Please can anyone of you help me how can I achieve this ?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;PNV&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 13:10:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-aws-service-name-from-source-field-of-metadata/m-p/684642#M233705</guid>
      <dc:creator>Poojitha</dc:creator>
      <dc:date>2024-04-18T13:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Extract aws service name from source field of metadata</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-aws-service-name-from-source-field-of-metadata/m-p/684645#M233707</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;split&lt;/FONT&gt; function is extracting the desired field, but then &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; reduces it to the part before the first underscore (_).&amp;nbsp; Remove the &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command and the query should work as expected.&lt;/P&gt;&lt;P&gt;In props..conf, add a transform that uses &lt;FONT face="courier new,courier"&gt;INGEST_EVAL&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;INGEST_EVAL = aws_service=mvindex(split(source,":"),2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 13:21:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-aws-service-name-from-source-field-of-metadata/m-p/684645#M233707</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-04-18T13:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Extract aws service name from source field of metadata</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-aws-service-name-from-source-field-of-metadata/m-p/684656#M233709</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp; : If dont use rex , it gets entire value i.e nat_gateways. I just want nat.&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;My requirement is it should just extract service name.&lt;BR /&gt;&lt;BR /&gt;Example :&lt;BR /&gt;434531263412:us-west-2:lambda_functions it will be lambda_functions. This is straight forward.&lt;BR /&gt;But like in&amp;nbsp; :&amp;nbsp;&lt;STRONG&gt;"434531263412:us-west-2:nat_gateways",&amp;nbsp;&lt;/STRONG&gt; it should be gateways.&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;434531263412&lt;/STRONG&gt;:&lt;STRONG&gt;us-west-2:application_load_balancers,&amp;nbsp;&lt;/STRONG&gt; it should be load_balancers&lt;BR /&gt;&lt;BR /&gt;This is my requirement.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 13:55:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-aws-service-name-from-source-field-of-metadata/m-p/684656#M233709</guid>
      <dc:creator>Poojitha</dc:creator>
      <dc:date>2024-04-18T13:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Extract aws service name from source field of metadata</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-aws-service-name-from-source-field-of-metadata/m-p/684690#M233713</link>
      <description>&lt;P&gt;To summarize:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;434531263412:us-west-2:lambda_functions -&amp;gt; lambda_functions&lt;BR /&gt;434531263412:us-west-2:nat_gateways&lt;STRONG&gt; -&amp;gt; &lt;/STRONG&gt;gateways&lt;BR /&gt;434531263412:us-west-2:application_load_balancers&lt;STRONG&gt; -&amp;gt;&lt;/STRONG&gt; load_balancers&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this is correct then more information is needed.&amp;nbsp; What is the rule to use to determine how much of the service is to be used?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 17:00:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-aws-service-name-from-source-field-of-metadata/m-p/684690#M233713</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-04-18T17:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Extract aws service name from source field of metadata</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-aws-service-name-from-source-field-of-metadata/m-p/684698#M233714</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp; : Sorry I did not get what rule you are mentioning. Could you please be more clear on this ?&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;434531263412:us-west-2:lambda_functions -&amp;gt; lambda_functions&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;434531263412:us-west-2:nat_gateways&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;-&amp;gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;gateways&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;434531263412:us-west-2:application_load_balancers&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;-&amp;gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;load_balancers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;yes , this is the requirement. In the above , right side values are the values from source field. I want to extract service name from this field value.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 18:15:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-aws-service-name-from-source-field-of-metadata/m-p/684698#M233714</guid>
      <dc:creator>Poojitha</dc:creator>
      <dc:date>2024-04-18T18:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Extract aws service name from source field of metadata</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-aws-service-name-from-source-field-of-metadata/m-p/684712#M233715</link>
      <description>&lt;P&gt;The requirements are inconsistent.&amp;nbsp; Sometimes everything after the second : is the service name; other times the service name follows the first _.&amp;nbsp; How is a computer to decide which method to use?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 20:32:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-aws-service-name-from-source-field-of-metadata/m-p/684712#M233715</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-04-18T20:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Extract aws service name from source field of metadata</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-aws-service-name-from-source-field-of-metadata/m-p/684747#M233729</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp; I agree to your point. I tried using case statement as well . Unfortunately its not working as expected. Do you know any other way to handle this ? That really helps me. I am also re-searching.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 06:37:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-aws-service-name-from-source-field-of-metadata/m-p/684747#M233729</guid>
      <dc:creator>Poojitha</dc:creator>
      <dc:date>2024-04-19T06:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extract aws service name from source field of metadata</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-aws-service-name-from-source-field-of-metadata/m-p/684764#M233732</link>
      <description>&lt;P&gt;I can't help if I don't understand what the goal is.&amp;nbsp; Once we have a deterministic way to set the service name I may be able to help.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 12:07:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-aws-service-name-from-source-field-of-metadata/m-p/684764#M233732</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-04-19T12:07:47Z</dc:date>
    </item>
  </channel>
</rss>

