<?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: Get conditional value from logs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525769#M148388</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;It is not working. I dont want&amp;nbsp;&lt;STRONG&gt;[name="IP BLOCK TYPE",value="Public",descendants_action={option_with_ea:"INHERIT",option_without_ea:"NOT_INHERIT"},operation="OVERRIDE"]&amp;nbsp;&lt;/STRONG&gt; to be printed as this has&amp;nbsp;&lt;STRONG&gt;operation="OVERRIDE".&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;so help me to discard this case while checking 1 and 2. 1st should print not second one.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Oct 2020 13:21:10 GMT</pubDate>
    <dc:creator>sgulhane5</dc:creator>
    <dc:date>2020-10-21T13:21:10Z</dc:date>
    <item>
      <title>Get conditional value from logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525648#M148355</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Team,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have two conditions as below and I need to find out the&amp;nbsp;&lt;STRONG&gt;operation="OVERRIDE" and other should be block&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1&amp;gt; [name="IP BLOCK TYPE",value="Private",operation="OVERRIDE"]&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In first case I applied&amp;nbsp; &amp;gt;&amp;gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;rex field=_raw "operation=\"(?&amp;lt;IP_Block_Type&amp;gt;.\w+)\"" | where isnotnull(IP_Block_Type) and I got&amp;nbsp;&lt;SPAN&gt;operation="OVERRIDE" value only in the IP_Block_Type column.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2&amp;gt;[name="IP BLOCK TYPE",value="Public",descendants_action={option_with_ea:"INHERIT",option_without_ea:"NOT_INHERIT"},operation="OVERRIDE"]&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In the second condition, I'm looking for a logic which would not take&amp;nbsp;&lt;STRONG&gt;"descendants_action={option_with_ea:"INHERIT",option_without_ea:"NOT_INHERIT"}"&amp;nbsp; but it should give &lt;STRONG&gt;operation="OVERRIDE" in a result.&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/215670" target="_blank"&gt;@Nisha18789&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168" target="_blank"&gt;@ITWhisperer&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 23:39:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525648#M148355</guid>
      <dc:creator>sgulhane5</dc:creator>
      <dc:date>2020-10-20T23:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get conditional value from logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525698#M148374</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex field=_raw "operation=\"(?&amp;lt;IP_Block_Type&amp;gt;.\w+)\"" 
| where isnotnull(IP_Block_Type)
| eval block=if(match(_raw,"descendants_action=\{option_with_ea:\"INHERIT\",option_without_ea:\"NOT_INHERIT\"\}"),1,0)
| where block=0&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 21 Oct 2020 07:40:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525698#M148374</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-21T07:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Get conditional value from logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525769#M148388</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;It is not working. I dont want&amp;nbsp;&lt;STRONG&gt;[name="IP BLOCK TYPE",value="Public",descendants_action={option_with_ea:"INHERIT",option_without_ea:"NOT_INHERIT"},operation="OVERRIDE"]&amp;nbsp;&lt;/STRONG&gt; to be printed as this has&amp;nbsp;&lt;STRONG&gt;operation="OVERRIDE".&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;so help me to discard this case while checking 1 and 2. 1st should print not second one.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 13:21:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525769#M148388</guid>
      <dc:creator>sgulhane5</dc:creator>
      <dc:date>2020-10-21T13:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get conditional value from logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525777#M148392</link>
      <description>&lt;P&gt;Does the block field appear in the results? What values appear for it? Block should be 1 if the string appears in the _raw event and therefore excluded by the where clause.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 13:12:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525777#M148392</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-21T13:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Get conditional value from logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525781#M148394</link>
      <description>&lt;P&gt;In a result, it is showing an&amp;nbsp;&lt;STRONG&gt;"OVERRIDE" &lt;/STRONG&gt;&amp;nbsp;but it is taking&amp;nbsp;&lt;STRONG&gt;operation="OVERRIDE"&amp;nbsp;&lt;/STRONG&gt; from 2nd condition also and I don't want that. I just want to print 1 condition with&amp;nbsp;&lt;STRONG&gt;operation="OVERRIDE"&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 13:25:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525781#M148394</guid>
      <dc:creator>sgulhane5</dc:creator>
      <dc:date>2020-10-21T13:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Get conditional value from logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525791#M148396</link>
      <description>&lt;P&gt;I don't understand - what is your full query? Also, can you provide a sample event which is coming through that you would like to be omitted?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 13:38:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525791#M148396</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-21T13:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get conditional value from logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525815#M148399</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;, the First snip shows the audit logs and I've highlighted the IP Block Type details in the Snip.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Audit logs" style="width: 624px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/11415i259938385550FE29/image-size/large?v=v2&amp;amp;px=999" role="button" title="image (6).png" alt="Audit logs" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Audit logs&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second snip showing an output printed for IP_Block_Type but it containing all the details descendant action etc that I don't want to print any value for that entries. That should be omitted.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snip2" style="width: 624px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/11414i6C5FD0BFCA1264F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="image (5).png" alt="Snip2" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Snip2&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The third Snip is showing the logic that I have used to get the details from the audit logs of IPAM.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Logic to fetch the data" style="width: 624px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/11416i162BE4E9C17F1A69/image-size/large?v=v2&amp;amp;px=999" role="button" title="image (4).png" alt="Logic to fetch the data" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Logic to fetch the data&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 14:28:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525815#M148399</guid>
      <dc:creator>sgulhane5</dc:creator>
      <dc:date>2020-10-21T14:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get conditional value from logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525829#M148401</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/226890"&gt;@sgulhane5&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks but the images are almost impossible to use. Can you copy and paste the third part into a code block?&lt;/P&gt;&lt;P&gt;I can see that there is something wrong with your IP_Block_Type extraction. Is that part of your logic, or has this field been extracted on indexing?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 15:04:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525829#M148401</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-21T15:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Get conditional value from logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525848#M148411</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;Please find the 3 part code-&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sourcetype=ib:audit index=ib_audit OBJECT_TYPE=*Network* OBJECT_TYPE!=*Container* ACTION=Created OBJECT_NAME!=10.* AND OBJECT_NAME!=172.16.* AND OBJECT_NAME!=172.17.* AND OBJECT_NAME!=172.18.* AND OBJECT_NAME!=172.19.* AND OBJECT_NAME!=172.20.* AND OBJECT_NAME!=172.21.* AND OBJECT_NAME!=172.22.* AND OBJECT_NAME!=172.23.* AND OBJECT_NAME!=172.24.* AND OBJECT_NAME!=172.25.* AND OBJECT_NAME!=172.26.* AND OBJECT_NAME!=172.27.* AND OBJECT_NAME!=172.28.* AND OBJECT_NAME!=172.29.* AND OBJECT_NAME!=172.30.* AND OBJECT_NAME!=172.31.* AND OBJECT_NAME!=192.168.* (earliest=-1year) | sort -_time | eval MESSAGE=replace(MESSAGE, "\\\\040", " ") | eval MESSAGE=replace(MESSAGE, "\\\\042", "\"") | eval MESSAGE=replace(MESSAGE, "\\\\054", ",") | eval MESSAGE=replace(MESSAGE, "\\\\072", ":") | eval MESSAGE=replace(MESSAGE, "\\\\075", "=") | eval MESSAGE=replace(MESSAGE, "\\\\076", "&amp;amp;amp;gt;") | eval MESSAGE=replace(MESSAGE, "\\\\133", "\[") | eval MESSAGE=replace(MESSAGE, "\\\\134", "\\") | eval MESSAGE=replace(MESSAGE, "\\\\135", "\]") | eval OBJECT_NAME=replace(OBJECT_NAME, "\\\\040", " ") | eval OBJECT_NAME=replace(OBJECT_NAME, "\\\\042", "\"") | eval OBJECT_NAME=replace(OBJECT_NAME, "\\\\054", ",") | eval OBJECT_NAME=replace(OBJECT_NAME, "\\\\072", ":") | eval OBJECT_NAME=replace(OBJECT_NAME, "\\\\075", "=") | eval OBJECT_NAME=replace(OBJECT_NAME, "\\\\076", "&amp;amp;amp;gt;") | eval OBJECT_NAME=replace(OBJECT_NAME, "\\\\133", "\[") | eval OBJECT_NAME=replace(OBJECT_NAME, "\\\\134", "\\") | eval OBJECT_NAME=replace(OBJECT_NAME, "\\\\135", "\]") |rex max_match=0 field=_raw "CITY\",value=\"(?&amp;lt;City&amp;gt;.*?)\s*(\w*+)\]"| eval City = substr(City, 1, len(City)-1) | rex max_match=0 field=_raw "REGION\",value=\"(?&amp;lt;Region&amp;gt;.*?)\s*(\w*+)\]"| eval Region = substr(Region, 1, len(Region)-1)| rex max_match=0 field=_raw "FLOOR\",value=\"(?&amp;lt;Floor&amp;gt;.*?)\s*(\w*+)\]"| eval Floor= substr(Floor, 1, len(Floor)-1)|rex max_match=0 field=_raw "COUNTRY\",value=\"(?&amp;lt;Country&amp;gt;.*?)\s*(\w*+)\]"| eval Country= substr(Country, 1, len(Country)-1)|rex max_match=0 field=_raw "CKT ID\",value=\"(?&amp;lt;CKT_ID&amp;gt;.*?)\s*(\w*+)\]"| eval CKT_ID= substr(CKT_ID, 1, len(CKT_ID)-1)| rex max_match=0 field=_raw "Assignor ID\",value=\"(?&amp;lt;Assignor_ID&amp;gt;.*?)\s*(\w*+)\]"| eval Assignor_ID= substr(Assignor_ID, 1, len(Assignor_ID)-1) |rex max_match=0 field=_raw "IP BLOCK TERMINATION DEVICE\",value=\"(?&amp;lt;IP_Block_Termination_Device&amp;gt;.*?)\s*(\w*+)\]"| eval IP_Block_Termination_Device= substr(IP_Block_Termination_Device, 1, len(IP_Block_Termination_Device)-1)| rex max_match=0 field=_raw "CR NUMBER\",value=\"(?&amp;lt;CR_Number&amp;gt;.*?)\s*(\w*+)\]"| eval CR_Number= substr(CR_Number, 1, len(CR_Number)-1) |rex max_match=0 field=_raw "DEPLOYMENT STATUS\",value=\[\"(?&amp;lt;Deployment_Status&amp;gt;[^\"]*)\"\]"| eval Deployment_Status= substr(Deployment_Status, 1, len(Deployment_Status)-0)| rex max_match=0 field=_raw "Network Location\",value=\"(?&amp;lt;Network_Location&amp;gt;.*?)\s*(\w*+)\]"| eval Network_Location= substr(Network_Location, 1, len(Network_Location)-1) |rex max_match=0 field=_raw "PROJECT NAME\",value=\"(?&amp;lt;Project_Name&amp;gt;.*?)\s*(\w*+)\]"| eval Project_Name= substr(Project_Name, 1, len(Project_Name)-1) |rex max_match=0 field=_raw "FIREWALL HOSTNAME\",value=\"(?&amp;lt;Firewall_Hostname&amp;gt;.*?)\s*(\w*+)\]"| eval Firewall_Hostname= substr(Firewall_Hostname, 1, len(Firewall_Hostname)-1) |rex max_match=0 field=_raw "PROJECT OWNER /SM MAIL ID\",value=\"(?&amp;lt;Project_Owner_SM_Mail_Id&amp;gt;.*?)\s*(\w*+)\]"| eval Project_Owner_SM_Mail_Id= substr(Project_Owner_SM_Mail_Id, 1, len(Project_Owner_SM_Mail_Id)-1)|rex max_match=0 field=_raw "PROJECT/OWNER NAME\",value=\"(?&amp;lt;Project_Owner_Name&amp;gt;.*?)\s*(\w*+)\]"| eval Project_Owner_Name= substr(Project_Owner_Name, 1, len(Project_Owner_Name)-1) |rex max_match=0 field=_raw "REGISTERED UNDER\",value=\"(?&amp;lt;Registered_Under&amp;gt;.*?)\s*(\w*+)\]"| eval Registered_Under= substr(Registered_Under, 1, len(Registered_Under)-1)|rex max_match=0 field=_raw "SR NUMBER\",value=\"(?&amp;lt;SR_Number&amp;gt;.*?)\s*(\w*+)\]"| eval SR_Number= substr(SR_Number, 1, len(SR_Number)-1)|rex max_match=0 field=_raw "SUB CATEGRORY : HOST IP Entity\",value=\"(?&amp;lt;Sub_Categrory_Host_IP_Entity&amp;gt;.*?)\s*(\w*+)\]"| eval Sub_Categrory_Host_IP_Entity= substr(Sub_Categrory_Host_IP_Entity, 1, len(Sub_Categrory_Host_IP_Entity)-1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;|rex max_match=0 field=_raw "BUILDING\",value=\[\"(?&amp;lt;Building&amp;gt;[^\"]*)\"\]"| eval Building= substr(Building, 1, len(Building)+1)| rex max_match=0 field=_raw "FIREWALL MANAGEMENT IP\",value=\"(?&amp;lt;Firewall_Management_IP&amp;gt;.*?)\s*(\w*+)\]"| eval Firewall_Management_IP= substr(Firewall_Management_IP, 1, len(Firewall_Management_IP)-1)|rex max_match=0 field=_raw "VLAN-ID\",value=\"(?&amp;lt;Vlan_ID&amp;gt;.*?)\s*(\w*+)\]"| eval Vlan_ID= substr(Vlan_ID, 1, len(Vlan_ID)-1) |rex max_match=0 field=_raw "VLAN-Name\",value=\"(?&amp;lt;Vlan_Name&amp;gt;.*?)\s*(\w*+)\]"| eval Vlan_Name= substr(Vlan_Name, 1, len(Vlan_Name)-1) |rex max_match=0 field=_raw "TERMINATION TECHNICAL CONTACT\",value=\"(?&amp;lt;Termination_Technical_Contact&amp;gt;.*?)\s*(\w*+)\]"| eval Termination_Technical_Contact= substr(Termination_Technical_Contact, 1, len(Termination_Technical_Contact)-1) |rex max_match=0 field=_raw "SUBNET TYPE\",value=\"(?&amp;lt;Subnet_Type&amp;gt;.*?)\s*(\w*+)\]"| eval Subnet_Type= substr(Subnet_Type, 1, len(Subnet_Type)-1) |rex max_match=0 field=_raw "OWNER OF SUBNET\",value=\"(?&amp;lt;Owner_Of_Subnet&amp;gt;.*?)\s*(\w*+)\]"| eval Owner_Of_Subnet= substr(Owner_Of_Subnet, 1, len(Owner_Of_Subnet)-1) |rex max_match=0 field=_raw "Network Comment\",value=\"(?&amp;lt;Network_Comment&amp;gt;.*?)\s*(\w*+)\]"| eval Network_Comment= substr(Network_Comment, 1, len(Network_Comment)-1) |rex max_match=0 field=_raw "GATEWAY 2 MANAGEMENT IP\",value=\"(?&amp;lt;Gateway_2_Management_IP&amp;gt;.*?)\s*(\w*+)\]"| eval Gateway_2_Management_IP= substr(Gateway_2_Management_IP, 1, len(Gateway_2_Management_IP)-1) |rex max_match=0 field=_raw "GATEWAY MANAGED BY\",value=\"(?&amp;lt;Gateway_Managed_By&amp;gt;.*?)\s*(\w*+)\]"| eval Gateway_Managed_By= substr(Gateway_Managed_By, 1, len(Gateway_Managed_By)-1)|rex max_match=0 field=_raw "GATEWAY TECHNICAL CONTACT\",value=\"(?&amp;lt;Gateway_Technical_Contact&amp;gt;.*?)\s*(\w*+)\]"| eval Gateway_Technical_Contact= substr(Gateway_Technical_Contact, 1, len(Gateway_Technical_Contact)-1)|rex max_match=0 field=_raw "GATEWAY1 MANAGEMENT IP\",value=\"(?&amp;lt;Gateway1_Management_IP&amp;gt;.*?)\s*(\w*+)\]"| eval Gateway1_Management_IP= substr(Gateway1_Management_IP, 1, len(Gateway1_Management_IP)-1) |rex max_match=0 field=_raw "HOST NAME GATEWAY1\",value=\"(?&amp;lt;Host_Name_Gateway1&amp;gt;.*?)\s*(\w*+)\]"| eval Host_Name_Gateway1= substr(Host_Name_Gateway1, 1, len(Host_Name_Gateway1)-1) |rex max_match=0 field=_raw "HOST NAME GATEWAY2\",value=\"(?&amp;lt;Host_Name_Gateway2&amp;gt;.*?)\s*(\w*+)\]"| eval Host_Name_Gateway2= substr(Host_Name_Gateway2, 1, len(Host_Name_Gateway2)-1) |rex max_match=0 field=_raw "HOST TYPE\",value=\"(?&amp;lt;Host_Type&amp;gt;.*?)\s*(\w*+)\]"| eval Host_Type= substr(Host_Type, 1, len(Host_Type)-1) |rex max_match=0 field=_raw "IP BLOCK TYPE\",value=\"(?&amp;lt;IP_Block_Type&amp;gt;.*?)\s*(\w*+)\]"| eval IP_Block_Type= substr(IP_Block_Type, 1, len(IP_Block_Type)-1) |rex max_match=0 field=_raw "ODC\",value=\"(?&amp;lt;ODC&amp;gt;.*?)\s*(\w*+)\]"| eval ODC= substr(ODC, 1, len(ODC)-1)|&lt;/SPAN&gt;&lt;SPAN&gt;rename TIMESTAMP as "Timestamp", ADMIN as "Admin", ACTION as "Action", OBJECT_TYPE as "Network Type", OBJECT_NAME as "Network", EXEC_STATUS as "Execution Status", MESSAGE as "Message", host as "Member" | table "Timestamp" "Admin" "Network Type" "Network" "City" "IP_Block_Type" "Region" "Country" "Network_Location" "Building" "ODC"&amp;nbsp; "Floor"&amp;nbsp; "Project_Name" "CKT_ID" "Assignor_ID" "IP_Block_Termination_Device" "CR_Number" "Deployment_Status" "Firewall_Hostname" "Project_Owner_SM_Mail_Id" "Project_Owner_Name" "Registered_Under" "SR_Number" "Firewall_Management_IP" "Vlan_ID" "Vlan_Name" "Termination_Technical_Contact" "Subnet_Type" "Owner_Of_Subnet" "Network_Comment" "Gateway_2_Management_IP" "Gateway_Managed_By" "Gateway_Technical_Contact" "Gateway1_Management_IP" "Host_Name_Gateway1" "Host_Name_Gateway2" "Host_Type"&amp;nbsp; "Sub_Categrory_Host_IP_Entity"&lt;/SPAN&gt;&lt;SPAN class="c-message__edited_label"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 15:58:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525848#M148411</guid>
      <dc:creator>sgulhane5</dc:creator>
      <dc:date>2020-10-21T15:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Get conditional value from logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525874#M148418</link>
      <description>&lt;P&gt;Try simplifying the rex and evals (I wasn't sure what was going on with Building and the length + 1)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|rex max_match=0 field=_raw "CITY\",value=\"(?&amp;lt;City&amp;gt;[^\"]+)"
| rex max_match=0 field=_raw "REGION\",value=\"(?&amp;lt;Region&amp;gt;[^\"]+)"
| rex max_match=0 field=_raw "FLOOR\",value=\"(?&amp;lt;Floor&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "COUNTRY\",value=\"(?&amp;lt;Country&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "CKT ID\",value=\"(?&amp;lt;CKT_ID&amp;gt;[^\"]+)"
| rex max_match=0 field=_raw "Assignor ID\",value=\"(?&amp;lt;Assignor_ID&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "IP BLOCK TERMINATION DEVICE\",value=\"(?&amp;lt;IP_Block_Termination_Device&amp;gt;[^\"]+)"
| rex max_match=0 field=_raw "CR NUMBER\",value=\"(?&amp;lt;CR_Number&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "DEPLOYMENT STATUS\",value=\[\"(?&amp;lt;Deployment_Status&amp;gt;[^\"]*)\"\]"
| rex max_match=0 field=_raw "Network Location\",value=\"(?&amp;lt;Network_Location&amp;gt;[^\"]+)" 
|rex max_match=0 field=_raw "PROJECT NAME\",value=\"(?&amp;lt;Project_Name&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "FIREWALL HOSTNAME\",value=\"(?&amp;lt;Firewall_Hostname&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "PROJECT OWNER /SM MAIL ID\",value=\"(?&amp;lt;Project_Owner_SM_Mail_Id&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "PROJECT/OWNER NAME\",value=\"(?&amp;lt;Project_Owner_Name&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "REGISTERED UNDER\",value=\"(?&amp;lt;Registered_Under&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "SR NUMBER\",value=\"(?&amp;lt;SR_Number&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "SUB CATEGRORY : HOST IP Entity\",value=\"(?&amp;lt;Sub_Categrory_Host_IP_Entity&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "BUILDING\",value=\[\"(?&amp;lt;Building&amp;gt;[^\"]*)\"\]"
| eval Building= substr(Building, 1, len(Building)+1)
| rex max_match=0 field=_raw "FIREWALL MANAGEMENT IP\",value=\"(?&amp;lt;Firewall_Management_IP&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "VLAN-ID\",value=\"(?&amp;lt;Vlan_ID&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "VLAN-Name\",value=\"(?&amp;lt;Vlan_Name&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "TERMINATION TECHNICAL CONTACT\",value=\"(?&amp;lt;Termination_Technical_Contact&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "SUBNET TYPE\",value=\"(?&amp;lt;Subnet_Type&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "OWNER OF SUBNET\",value=\"(?&amp;lt;Owner_Of_Subnet&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "Network Comment\",value=\"(?&amp;lt;Network_Comment&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "GATEWAY 2 MANAGEMENT IP\",value=\"(?&amp;lt;Gateway_2_Management_IP&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "GATEWAY MANAGED BY\",value=\"(?&amp;lt;Gateway_Managed_By&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "GATEWAY TECHNICAL CONTACT\",value=\"(?&amp;lt;Gateway_Technical_Contact&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "GATEWAY1 MANAGEMENT IP\",value=\"(?&amp;lt;Gateway1_Management_IP&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "HOST NAME GATEWAY1\",value=\"(?&amp;lt;Host_Name_Gateway1&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "HOST NAME GATEWAY2\",value=\"(?&amp;lt;Host_Name_Gateway2&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "HOST TYPE\",value=\"(?&amp;lt;Host_Type&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "IP BLOCK TYPE\",value=\"(?&amp;lt;IP_Block_Type&amp;gt;[^\"]+)"
|rex max_match=0 field=_raw "ODC\",value=\"(?&amp;lt;ODC&amp;gt;[^\"]+)"&lt;/LI-CODE&gt;&lt;P&gt;Where in the search were you putting the suggested eval for block?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 17:32:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-conditional-value-from-logs/m-p/525874#M148418</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-21T17:32:34Z</dc:date>
    </item>
  </channel>
</rss>

