The Token is on middle of lines. I tried some possibilities, but not match, like:
sed -n '/matched/,$p' file
sed -n '/token=/,$p' file > out.txt
grep -oP '(?<=token: ).*' file
grep -Po 'token\s\K.*' file
I have this:
207.244.229.206 - - [28/Mar/2022:14:35:32 -0300] "GET /api_producao.php/procedimento?filter[]=status,eq,SIM&filter[]=clinicaId,eq,50&transform=1&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMSwiaXNzIjoiaHR0cHM6Ly9zZHJwb3J0by5jb20uYnIvYmFjay9vZG9udG9sb2dpYS9wdWJsaWMvYXBpL3YxL3NpZ25pbiIsImlhdCI6MTY0ODQ4Njk4MCwiZXhwIjoxNjQ4NDkwNTgwLCJuYmYiOjE2NDg0ODY5ODAsImp0aSI6IndsZVNhZ1ppb3VWVUFRb2cifQ.gnAzxxtWNdUY_Ech0Lj5v8TNMvSTOnjLWLHYhY3eMvE HTTP/1.1" 200 71194 "-" "GuzzleHttp/6.5.5 curl/7.81.0 PHP/7.4.28"
207.244.229.206 - - [28/Mar/2022:14:35:32 -0300] "GET /api_producao.php/salas?filter=clinicaId,eq,50&transform=1&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMSwiaXNzIjoiaHR0cHM6Ly9zZHJwb3J0by5jb20uYnIvYmFjay9vZG9udG9sb2dpYS9wdWJsaWMvYXBpL3YxL3NpZ25pbiIsImlhdCI6MTY0ODQ4Njk4MCwiZXhwIjoxNjQ4NDkwNTgwLCJuYmYiOjE2NDg0ODY5ODAsImp0aSI6IndsZVNhZ1ppb3VWVUFRb2cifQ.gnAzxxtWNdUY_Ech0Lj5v8TNMvSTOnjLWLHYhY3eMvE HTTP/1.1" 200 303 "-" "GuzzleHttp/6.5.5 curl/7.81.0 PHP/7.4.28"
207.244.229.206 - - [28/Mar/2022:14:35:32 -0300] "PUT /api_producao.php/sala_horario/14 HTTP/1.1" 200 1 "-" "GuzzleHttp/6.5.5 curl/7.81.0 PHP/7.4.28"
207.244.229.206 - - [28/Mar/2022:14:35:32 -0300] "GET /api_producao.php/sala_horario?filter=salaID,eq,15&transform=1&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMSwiaXNzIjoiaHR0cHM6Ly9zZHJwb3J0by5jb20uYnIvYmFjay9vZG9udG9sb2dpYS9wdWJsaWMvYXBpL3YxL3NpZ25pbiIsImlhdCI6MTY0ODQ4Njk4MCwiZXhwIjoxNjQ4NDkwNTgwLCJuYmYiOjE2NDg0ODY5ODAsImp0aSI6IndsZVNhZ1ppb3VWVUFRb2cifQ.gnAzxxtWNdUY_Ech0Lj5v8TNMvSTOnjLWLHYhY3eMvE HTTP/1.1" 200 141 "-" "GuzzleHttp/6.5.5 curl/7.81.0 PHP/7.4.28"
207.244.229.206 - - [28/Mar/2022:14:35:33 -0300] "GET /api_producao.php/aux_clinica_profissional?filter=clinicaId,eq,42&transform=1&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMiwiaXNzIjoiaHR0cHM6Ly93d3cuc2RycG9ydG8uY29tLmJyL2JhY2svb2RvbnRvbG9naWEvcHVibGljL2FwaS92MS9zaWduaW4iLCJpYXQiOjE2NDg0ODc1OTksImV4cCI6MTY0ODQ5MTE5OSwibmJmIjoxNjQ4NDg3NTk5LCJqdGkiOiJUZEtqTnlnWWxiZkJmVEpWIn0.ZNIZJtJQS8BbITnkgGL8j-8g7q47nZ7TTdIA2-6s2k4 HTTP/1.1" 200 2730 "-" "GuzzleHttp/6.5.5 curl/7.81.0 PHP/7.4.28"
207.244.229.206 - - [28/Mar/2022:14:35:33 -0300] "GET /api_producao.php/profissional?filter=id,in,5,0,9,7,51,10,25,24,33,34,48,0,45,27,105,130,115,118,119,124,0,127&transform=1&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMiwiaXNzIjoiaHR0cHM6Ly93d3cuc2RycG9ydG8uY29tLmJyL2JhY2svb2RvbnRvbG9naWEvcHVibGljL2FwaS92MS9zaWduaW4iLCJpYXQiOjE2NDg0ODc1OTksImV4cCI6MTY0ODQ5MTE5OSwibmJmIjoxNjQ4NDg3NTk5LCJqdGkiOiJUZEtqTnlnWWxiZkJmVEpWIn0.ZNIZJtJQS8BbITnkgGL8j-8g7q47nZ7TTdIA2-6s2k4 HTTP/1.1" 200 10827 "-" "GuzzleHttp/6.5.5 curl/7.81.0 PHP/7.4.28"
207.244.229.206 - - [28/Mar/2022:14:35:33 -0300] "GET /api_producao.php/sala_horario?filter=salaID,eq,15&transform=1&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMSwiaXNzIjoiaHR0cHM6Ly9zZHJwb3J0by5jb20uYnIvYmFjay9vZG9udG9sb2dpYS9wdWJsaWMvYXBpL3YxL3NpZ25pbiIsImlhdCI6MTY0ODQ4Njk4MCwiZXhwIjoxNjQ4NDkwNTgwLCJuYmYiOjE2NDg0ODY5ODAsImp0aSI6IndsZVNhZ1ppb3VWVUFRb2cifQ.gnAzxxtWNdUY_Ech0Lj5v8TNMvSTOnjLWLHYhY3eMvE HTTP/1.1" 200 141 "-" "GuzzleHttp/6.5.5 curl/7.81.0 PHP/7.4.28"
And need this:
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMSwiaXNzIjoiaHR0cHM6Ly9zZHJwb3J0by5jb20uYnIvYmFjay9vZG9udG9sb2dpYS9wdWJsaWMvYXBpL3YxL3NpZ25pbiIsImlhdCI6MTY0ODQ4Njk4MCwiZXhwIjoxNjQ4NDkwNTgwLCJuYmYiOjE2NDg0ODY5ODAsImp0aSI6IndsZVNhZ1ppb3VWVUFRb2cifQ.gnAzxxtWNdUY_Ech0Lj5v8TNMvSTOnjLWLHYhY3eMvE
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMSwiaXNzIjoiaH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UZEtqTnlnWWxiZkJmVEpWIn0.ZNIZJtJQS8BbITnkgGL8j-8g7q47nZ7TTdIA2-6s2k4
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMSwiaXNzIjoiaHR0cHM6Ly9zZHJwb3J0by5jb20uYnIvYmFjay9vZG9udG9sb2dpYS9wdWJsaWMvYXBpL3YxL3NpZ25pbiIsImlhdCI6MTY0ODQ4Njk4MCwiZXhwIjoxNjQ4NDkwNTgwLCJuYmYiOjE2NDg0ODY5ODAsImp0aSI6IndsZVNhZ1ppb3VWVUFRb2cifQ.gnAzxxtWNdUY_Ech0Lj5v8TNMvSTOnjLWLHYhY3eMvE
CodePudding user response:
You can use
grep -Po 'token=\K\S ' file
Sed solution:
sed -nE 's/.*token=([^[:space:]] ).*/\1/p' file
See the regex demo. Details:
token=
- a fixed substring\K
- match reset operator that discards the text matched so far from the current match memory buffer\S
- one or more non-whitespace chars.
See the online demo:
#!/bin/bash
s='207.244.229.206 - - [28/Mar/2022:14:35:32 -0300] "GET /api_producao.php/procedimento?filter[]=status,eq,SIM&filter[]=clinicaId,eq,50&transform=1&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMSwiaXNzIjoiaHR0cHM6Ly9zZHJwb3J0by5jb20uYnIvYmFjay9vZG9udG9sb2dpYS9wdWJsaWMvYXBpL3YxL3NpZ25pbiIsImlhdCI6MTY0ODQ4Njk4MCwiZXhwIjoxNjQ4NDkwNTgwLCJuYmYiOjE2NDg0ODY5ODAsImp0aSI6IndsZVNhZ1ppb3VWVUFRb2cifQ.gnAzxxtWNdUY_Ech0Lj5v8TNMvSTOnjLWLHYhY3eMvE HTTP/1.1" 200 71194 "-" "GuzzleHttp/6.5.5 curl/7.81.0 PHP/7.4.28"
207.244.229.206 - - [28/Mar/2022:14:35:32 -0300] "GET /api_producao.php/salas?filter=clinicaId,eq,50&transform=1&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMSwiaXNzIjoiaHR0cHM6Ly9zZHJwb3J0by5jb20uYnIvYmFjay9vZG9udG9sb2dpYS9wdWJsaWMvYXBpL3YxL3NpZ25pbiIsImlhdCI6MTY0ODQ4Njk4MCwiZXhwIjoxNjQ4NDkwNTgwLCJuYmYiOjE2NDg0ODY5ODAsImp0aSI6IndsZVNhZ1ppb3VWVUFRb2cifQ.gnAzxxtWNdUY_Ech0Lj5v8TNMvSTOnjLWLHYhY3eMvE HTTP/1.1" 200 303 "-" "GuzzleHttp/6.5.5 curl/7.81.0 PHP/7.4.28"
207.244.229.206 - - [28/Mar/2022:14:35:32 -0300] "PUT /api_producao.php/sala_horario/14 HTTP/1.1" 200 1 "-" "GuzzleHttp/6.5.5 curl/7.81.0 PHP/7.4.28"
207.244.229.206 - - [28/Mar/2022:14:35:32 -0300] "GET /api_producao.php/sala_horario?filter=salaID,eq,15&transform=1&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMSwiaXNzIjoiaHR0cHM6Ly9zZHJwb3J0by5jb20uYnIvYmFjay9vZG9udG9sb2dpYS9wdWJsaWMvYXBpL3YxL3NpZ25pbiIsImlhdCI6MTY0ODQ4Njk4MCwiZXhwIjoxNjQ4NDkwNTgwLCJuYmYiOjE2NDg0ODY5ODAsImp0aSI6IndsZVNhZ1ppb3VWVUFRb2cifQ.gnAzxxtWNdUY_Ech0Lj5v8TNMvSTOnjLWLHYhY3eMvE HTTP/1.1" 200 141 "-" "GuzzleHttp/6.5.5 curl/7.81.0 PHP/7.4.28"
207.244.229.206 - - [28/Mar/2022:14:35:33 -0300] "GET /api_producao.php/aux_clinica_profissional?filter=clinicaId,eq,42&transform=1&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMiwiaXNzIjoiaHR0cHM6Ly93d3cuc2RycG9ydG8uY29tLmJyL2JhY2svb2RvbnRvbG9naWEvcHVibGljL2FwaS92MS9zaWduaW4iLCJpYXQiOjE2NDg0ODc1OTksImV4cCI6MTY0ODQ5MTE5OSwibmJmIjoxNjQ4NDg3NTk5LCJqdGkiOiJUZEtqTnlnWWxiZkJmVEpWIn0.ZNIZJtJQS8BbITnkgGL8j-8g7q47nZ7TTdIA2-6s2k4 HTTP/1.1" 200 2730 "-" "GuzzleHttp/6.5.5 curl/7.81.0 PHP/7.4.28"
207.244.229.206 - - [28/Mar/2022:14:35:33 -0300] "GET /api_producao.php/profissional?filter=id,in,5,0,9,7,51,10,25,24,33,34,48,0,45,27,105,130,115,118,119,124,0,127&transform=1&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMiwiaXNzIjoiaHR0cHM6Ly93d3cuc2RycG9ydG8uY29tLmJyL2JhY2svb2RvbnRvbG9naWEvcHVibGljL2FwaS92MS9zaWduaW4iLCJpYXQiOjE2NDg0ODc1OTksImV4cCI6MTY0ODQ5MTE5OSwibmJmIjoxNjQ4NDg3NTk5LCJqdGkiOiJUZEtqTnlnWWxiZkJmVEpWIn0.ZNIZJtJQS8BbITnkgGL8j-8g7q47nZ7TTdIA2-6s2k4 HTTP/1.1" 200 10827 "-" "GuzzleHttp/6.5.5 curl/7.81.0 PHP/7.4.28"
207.244.229.206 - - [28/Mar/2022:14:35:33 -0300] "GET /api_producao.php/sala_horario?filter=salaID,eq,15&transform=1&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMSwiaXNzIjoiaHR0cHM6Ly9zZHJwb3J0by5jb20uYnIvYmFjay9vZG9udG9sb2dpYS9wdWJsaWMvYXBpL3YxL3NpZ25pbiIsImlhdCI6MTY0ODQ4Njk4MCwiZXhwIjoxNjQ4NDkwNTgwLCJuYmYiOjE2NDg0ODY5ODAsImp0aSI6IndsZVNhZ1ppb3VWVUFRb2cifQ.gnAzxxtWNdUY_Ech0Lj5v8TNMvSTOnjLWLHYhY3eMvE HTT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uc2RycG9ydG8uY29tLmJyL2JhY2svb2RvbnRvbG9naWEvcHVibGljL2FwaS92MS9zaWduaW4iLCJpYXQiOjE2NDg0ODc1OTksImV4cCI6MTY0ODQ5MTE5OSwibmJmIjoxNjQ4NDg3NTk5LCJqdGkiOiJUZEtqTnlnWWxiZkJmVEpWIn0.ZNIZJtJQS8BbITnkgGL8j-8g7q47nZ7TTdIA2-6s2k4
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMiwiaXNzIjoiaHR0cHM6Ly93d3cuc2RycG9ydG8uY29tLmJyL2JhY2svb2RvbnRvbG9naWEvcHVibGljL2FwaS92MS9zaWduaW4iLCJpYXQiOjE2NDg0ODc1OTksImV4cCI6MTY0ODQ5MTE5OSwibmJmIjoxNjQ4NDg3NTk5LCJqdGkiOiJUZEtqTnlnWWxiZkJmVEpWIn0.ZNIZJtJQS8BbITnkgGL8j-8g7q47nZ7TTdIA2-6s2k4
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMSwiaXNzIjoiaHR0cHM6Ly9zZHJwb3J0by5jb20uYnIvYmFjay9vZG9udG9sb2dpYS9wdWJsaWMvYXBpL3YxL3NpZ25pbiIsImlhdCI6MTY0ODQ4Njk4MCwiZXhwIjoxNjQ4NDkwNTgwLCJuYmYiOjE2NDg0ODY5ODAsImp0aSI6IndsZVNhZ1ppb3VWVUFRb2cifQ.gnAzxxtWNdUY_Ech0Lj5v8TNMvSTOnjLWLHYhY3eMvE
The sed command means
-n
- suppress default line outputE
- enable POSIX ERE syntax.*token=([^[:space:]] ).*
- find any text, thentoken=
, then capture any one or more non-whitespace chars into Group 1 and then match the rest of the text on the line\1
- replace the match with Group 1 valuep
-p
rint the result of the substitution.
NOTE:
Whenever the value you need to extract has no space protocol name right after it, and there can be other query params after the token
one, you need to negate &
as well as whitespace. Then just use grep -Po 'token=\K[^&\s] ' file
and sed -nE 's/.*token=([^&[:space:]] ).*/\1/p' file
.
CodePudding user response:
Looks like you want
sed -n 's/.*token=\([^ &]*\).*/\1/p' file
or
grep -Po 'token=\K[^ &]*' file
CodePudding user response:
Using sed
$ sed -n '/GET/{s/.*=//;s/ .*//p}' input_file
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMSwiaXNzIjoiaHR0cHM6Ly9zZHJwb3J0by5jb20uYnIvYmFjay9vZG9udG9sb2dpYS9wdWJsaWMvYXBpL3YxL3NpZ25pbiIsImlhdCI6MTY0ODQ4Njk4MCwiZXhwIjoxNjQ4NDkwNTgwLCJuYmYiOjE2NDg0ODY5ODAsImp0aSI6IndsZVNhZ1ppb3VWVUFRb2cifQ.gnAzxxtWNdUY_Ech0Lj5v8TNMvSTOnjLWLHYhY3eMvE
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMSwiaXNzIjoiaHR0cHM6Ly9zZHJwb3J0by5jb20uYnIvYmFjay9vZG9udG9sb2dpYS9wdWJsaWMvYXBpL3YxL3NpZ25pbiIsImlhdCI6MTY0ODQ4Njk4MCwiZXhwIjoxNjQ4NDkwNTgwLCJuYmYiOjE2NDg0ODY5ODAsImp0aSI6IndsZVNhZ1ppb3VWVUFRb2cifQ.gnAzxxtWNdUY_Ech0Lj5v8TNMvSTOnjLWLHYhY3eMvE
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjExMSwiaXNzIjoiaHR0cHM6Ly9zZHJwb3J0by5jb20uYnIvYmFjay9vZG9udG9sb2dpYS9wdWJsaWMvYXBpL3YxL3NpZ25pbiIsImlhdCI6MTY0ODQ4Njk4MCwiZXhwIjoxNjQ4NDkwNTgwLCJuYmYiOjE2NDg0ODY5ODAsImp0aSI6IndsZVNhZ1ppb3VWVUFRb2cifQ.gnAzxxtWNdUY_Ech0Lj5v8TNMvSTOnjLWLHYhY3eMvE
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1Ni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