hi
I lately started to use Splunk db connect, and need to create an input that contains entries from different hosts.
is there any way that the host field value will be a column in the result of the SQL query, and not a constant value?
I tried to just name one of the columns 'host', but it didn't work.
Look at
Dynamically set the default host value
http://docs.splunk.com/Documentation/Splunk/6.0.1/Data/setadefaulthostforaninput
If you export your hostname as another name and use this method, you should be able to set the host based on a field returned.
Look at
Dynamically set the default host value
http://docs.splunk.com/Documentation/Splunk/6.0.1/Data/setadefaulthostforaninput
If you export your hostname as another name and use this method, you should be able to set the host based on a field returned.
A host by any other name is still a host.
Why not name the field/column dbhost?
That way you will know which 'host' it came from, and also be able to identify the 'host' from within the source.
Specific information a little more is required for me to answer.
↓Is not it's not the kind of thing?
SELECT *,"HOSTNAME_XXX" as host FROM TableName
You could name it DBHost and use that in searches etc..
no, this doesn't work for me either. the host field is ignored
as i said above, naming one of the columns 'host' doesn't work...
Please forgive me because it is not good at English I.
Or that we also wish to retrieve the host name of the target DB on the results of SQL?
(For example, if MySQL)
select A,B,C, substring(CURRENT_USER(),locate("@",CURRENT_USER())+1) as host from TableName